[NEWBIE] access return values
paul at subsignal.org
Thu Sep 18 12:22:40 CEST 2003
during the last couple of days I wrote my first small app with wxPython
and it all works pretty well, but now I'm somewhat lost. I'd like to
access the return value from a function inside an imported module (a
method of a class of that module eh?)
from wxPython.wx import *
from app.py import *
user=UserObject(config) # class instance from app.py
the class UserObject has a function set_pwd() which returns a var, say
"ch_success" indicating success/failure wich I'd like to pass to a
Dialog to give some feedback to the user.
d=wxMessageDialog(self, user.ch_success,"Info:", wxICON_INFORMATION | wxOK)
AttributeError: UserObject instance has no attribute 'ch_success'
That makes sense, since ch_success is a local variable of set_pwd(), so
I tried to make it global but with very little success so far. I tried:
def set_pwd(someargs, moreargs)
do stuff //
Nothing worked (but frankly, I don't really know what I'm doing here).
Any ideas? Thanks
More information about the Python-list