Module import problems

simo simoninusa2001 at yahoo.co.uk
Mon Apr 5 12:27:19 EDT 2004


login.login or login.login() don't work.

I tried adding...

def simon():
    print "hello"

...to the top of login.py (before the login class) and then calling
login.simon() and that works - but then that's a def, not a class....

So I think the login class is failing to initialise as it can't find
the wx class imported in main.py, because if I run login.py then I get
"...wx not defined" surely I don't have to import wx in every file
(that doesn't work actually)?!

This namespace crap is becomming an inconvenience - jees, do we have
to make everything global?!

Also, does IDLE cache the compiled Python or something, as sometimes
when I change a file and save/run it in the shell, it doesn't change
(I do delete the .pyc files) until I quit and reload IDLE?

This is with Python 2.3.2/Solaris (ActiveState) and 2.3.3/Windows
(python.org) and wxPython 2.4.2.4/2.5.1.5



More information about the Python-list mailing list