Is there some way I can compile a .py script into a .pyc but only if it is missing or out-of-date with the.py file?
I am trying to compile the file if necessary and then run it from within Python, can exec() run a .pyc file?
import py_compile py_compile.compile('Child.py') exec(open('Child.py').read())
This works but recompiles the file on every run.