Re: [Anygui-users] help me...
Brought to you by:
mlh
From: Magnus L. H. <ma...@he...> - 2004-09-30 11:44:00
|
st*rbrite <mo...@ho...>: > > I have downloaded Anygui. > I am using Python Win on XP operating sys. > I am learning Python; self-teaching myself from the Practical Python > book. > > I am having problems implementing the app = Application( ) > I get the following error: > > Traceback (most recent call last): > File > "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py" Hm. I'm not quite familiar with the scriptutils part of the PythonWin framework, really... I guess it may be interacting unfavourably with the way Anygui dynamically loads things, perhaps? > , line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\Documents and Settings\M&I\My Documents\Python Programs\Gui > test.py", line 2, in ? > app = Application() > NameError: name 'Application' is not defined > > This is my Python Script: > > from anygui import * > app = Application() [snip] Well, if things were working as they should, you should *not* be getting a NameError here. It does seem that the RunScript thing (which gives the error) messes directly with namespaces etc., which Anygui also does. I would guess that running your program with an ordinary Python interpreter would (or, at least, could ;) work... [snip] > I had this issue before and I reinstalled Anygui. It seemed to help, > but in the middle of my work, after successfully creating my 'box', > I ran it again and I received the above error. Very strange. As I said, this seems to be some problem in the interaction between Anygui and the PythonWin RunScript thing. I'm not sure how it works -- you could perhaps ask on a PythonWin list? A possible solution would be to import things directly from the back-end of your choice. E.g., from anygui.backends.mswgui import * app = Application() ... If you're running PythonWin, I guess the mswgui back-end should work. > Please Help. is it just me. am I missing something. No, I don't think you're doing anything wrong -- at least not as far as I can see. > lol; Thank you > Monica. -- Magnus Lie Hetland Fallen flower I see / Returning to its branch http://hetland.org Ah! a butterfly. [Arakida Moritake] |