import headaches/gripes

David Fuess fuess at att.net
Sat Mar 10 10:06:38 EST 2001


I think the problem is that PythonWin sets up the Python environment
in the beginning and everything runs under that environment. It gets
dirty as you develop so you eventually have to clean house. Your
import statements are ignored because the module already exists in the
environment. Changing that would affect multiple instances of import
on a module in an application. Kind of a Catch-22, eh?

You should try programming Tkinter apps under PythonWin. The
environment gets ditry after one or two iterations and sometimes has
to be killed from outside!!

Dave

On Sat, 10 Mar 2001 14:52:08 GMT, costas at meezon.com (Costas Menico)
wrote:

>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