When I compile on Windows a py-file into another folder then the pyc-file shortly appears and disappears an instant later.
Here the sample code I execute:
from py_compile import compile
source = r"E:\proj\abc\__init__.py"
dest = r"E:\proj\bin_abc\__init__.pyc"
print(compile(source, cfile=dest, doraise=True))
Now, if I compile the pyc in the same destination folder than the py-file resides in, then it does not disappear ?!??
Has anybody an explanation for this behavior?
Update: I figured out that it is Aptana Studio that is responsible for deleting the pyc-files:
- the files remain if I compile them into a directory outside my Aptana project. (If
destisE:\temp\__init__.pycfor example). - the files are deleted if I run the code snipped outside Aptana and Aptana is open.
- the files remain if I run the code snipped and Aptana is closed
Why does Aptana delete my pyc-files?
Automatic pyc deletion is a “feature” of PyDev: