reloading updated modules in long running server?

aurora aurora00 at gmail.com
Fri Oct 15 19:36:40 CEST 2004


I am looking for a way for reloading updated modules in a long running  
server. I'm not too concerned about cascaded reload or objects already  
created. Just need to reload module xxx if the corresponding xxx.py is  
updated.

I found something useful in module.__file__. Would it work if I use it to  
generate filenames xxx.py xxx.pyc and then compare their mtime? I'm not  
too sure about the mechanism of generation of .pyc file. Would it be too  
system specific to reply on?



More information about the Python-list mailing list