import headaches/gripes

Costas Menico costas at meezon.com
Sat Mar 10 15:52:08 CET 2001


I am using Pythonwin to develop apps.  I usually have a few modules
open. My main module imports all the necessary files at the start.

However when I change a module, I have to remember to reload() it
manually or quit Pythonwin. 

Why can't the import statement be smart enough to check if a file was
changed to import it anyway? All it has to do is compare .py to the
last import date/time.

Given my gripe is there some way I can force imports? It seems the
only way to do this is somehow to use reload(module name). Maybe some
logic like this would work:

if module_exists(utils):
	reload(utils)
else:
	import utils


where module_exists() is some imaginary function that can check if the
module is loaded.

Any ideas would be appreciated.

Costas




More information about the Python-list mailing list