I feel like I'm being really dumb with this. I know I can compile a .py file to .pyc with python -m compileall
with the logic that the script will load faster because it's pre-compiled, but that doesn't seem to be a useable feature if it's the primary script. To explain what I mean, lets say I run test.py from command line like so:
python test.py
Now let's assume test.py is a large file that takes some time to convert to byte code, the logical thing to do is precompile it, so I run the following in command:
python -m compileall test.py
Then I go and run the script again using:
python test.py
If I understand correctly, the test.py file is recompiled, basically making the pre-compile pointless. Am I getting this wrong? If I'm not, is there a way around this?