I am a complete newb to python, hence a silly question.
As i understand, upon first execution of a *.py program, byte code is created into *.pyc and used until a change in *.py file.
Where might this *.pyc bytecode be found in a project?
I would think bin, but nothing is there
A *.pyc file is created for imported modules, and they are placed in the same directory containing the .py file. However… no .pyc file is created for the main script for your program. In other words… if you call “python myscript.py” on the command line, there will be no .pyc file for myscript.py.
This is how Python 2.x behaves. However, in Python 3.x the .pyc files are saved in a
__pycache__directory. See David Glick’s answer for details.[edit: Added note about Python 3.x.]