one method that should always work is to start python shell and then import the file here is how that looksimport chaos this program illustrates chaotic function enter number between and typing the first line import chaos tells the python interpreter to load the chaos module from the file chaos py into main memory notice that did not include the py extension on the import linepython assumes the module will have py extension as python imports the module fileeach line executes it' just as if we had typed them oneby-one at the interactive python prompt the def in the module causes python to create the main function when python encounters the last line of the modulethe main function is invokedthus running our program the running program asks the user to enter number between and (in this casei typed "and then prints out series of numbers when you first import module file in this waypython creates companion file with pyc extension in this examplepython creates another file on the disk called chaos pyc this is an intermediate file used by the python interpreter technicallypython uses hybrid compiling/interpreting process the python source in the module file is compiled into more primitive instructions called byte code this byte code (the pycfile is then interpreted having pyc file available makes importing module faster the second time around howeveryou may delete the byte code files if you wish to save disk spacepython will automatically recreate them as needed module needs to be imported into session only once after the module has been loadedwe can run the program again by asking python to execute the main command we do this by using special dot notation typing chaos main(tells python to invoke the main function in the chaos module continuing with our examplehere is how it looks when we rerun the program with as the inputchaos main(this program illustrates chaotic function enter number between and