I have a project that I have compiled into .pyc files for security, but I want to be able to drop a .py file into my project for debugging purposes as necessary. How can I tell python to use a .py file if both the .py and .pyc files are present in a folder?
i.e. I have:
main:
|
run.pyc
/src/
|
dependency1.pyc
dependency2.pyc
dependency2.py
dependency3.pyc
and when both dependency2.pyc and dependency2.py are in /src/ I want run.pyc to use dependency2.py.
With respect to debugging.
From Python docs:
In your case,
run.pyshould be usingdependency2.pyand ignoring the associatedpyc, which in turn should allow you to debug.If that's not happening, try to temporarily move the compiled file
dependency2.pycout of the directory.