pythonimportcompilation

Prevent python imports compiling


I have have a python file that imports a few frequently changed python files. I have had trouble with the imported files not recompiling when I change them. How do I stop them compiling?


Solution

  • I don't think that's possible - its the way Python works. The best you could do, I think, is to have some kind of automated script which deletes *.pyc files at first. Or you could have a development module which automatically compiles all imports - try the compile module.

    I've personally not had this trouble before, but try checking the timestamps on the files. You could try running touch on all the Python files in the directory. (find -name \\*.py -exec touch \\{\\} \\;)