Module import problems

simo simoninusa2001 at yahoo.co.uk
Mon Apr 5 17:35:21 EDT 2004


Yay, I've done it!

I had to resort to "from login import *" in main.py and then "import
wx" (and other modules like urllib/webbrowser etc) in login.py and it
all seems to work.

I didn't occur to me that I'd have to import the modules used in each
module file, I thought it would work just from the parent (main.py)
file.

I've also stopped myself from calling classes instead of defs (I had
the whole class in the __init__ def previously) and removed most of my
global variables.

Now I have twelve 1-6Kb files like login.py, plus an 18Kb main.py,
instead of one 38Kb main.py to grep through!

So it was worth the struggle to clean up a bit....



More information about the Python-list mailing list