__pycache__ located in the directory where your source files resideand in files whose names identify the python version that created them ( script cpython- pycthe new __pycache__ subdirectory helps to avoid clutterand the new naming convention for byte code files prevents different python versions installed on the same computer from overwriting each other' saved byte code we'll study these byte code file models in more detail in though they are automatic and irrelevant to most python programsand are free to vary among the alternative python implementations described ahead in both modelspython saves byte code like this as startup speed optimization the next time you run your programpython will load the pyc files and skip the compilation stepas long as you haven' changed your source code since the byte code was last savedand aren' running with different python than the one that created the byte code it works like thissource changespython automatically checks the last-modified timestamps of source and byte code files to know when it must recompile--if you edit and resave your source codebyte code is automatically re-created the next time your program is run python versionsimports also check to see if the file must be recompiled because it was created by different python versionusing either "magicversion number in the byte code file itself in and earlieror the information present in byte code filenames in and later the result is that both source code changes and differing python version numbers will trigger new byte code file if python cannot write the byte code files to your machineyour program still works--the byte code is generated in memory and simply discarded on program exit howeverbecause pyc files speed startup timeyou'll want to make sure they are written for larger programs byte code files are also one way to ship python programs--python is happy to run program if all it can find are pyc fileseven if the original py source files are absent (see "frozen binarieson page for another shipping option finallykeep in mind that byte code is saved in files only for files that are importednot for the top-level files of program that are only run as scripts (strictly speakingit' an import optimizationwe'll explore import basics in and take deeper look at imports in part moreovera given file is only imported (and possibly compiledonce per program runand byte code is also never saved for code typed at the interactive prompt-- programming mode we'll learn about in the python virtual machine (pvmonce your program has been compiled to byte code (or the byte code has been loaded from existing pyc files)it is shipped off for execution to something generally known as the python virtual machine (pvmfor the more acronym-inclined among youthe program execution