Re: confusion between global names and instantiated object variable names

2005-10-14 Thread Alex Martelli
wanwan <[EMAIL PROTECTED]> wrote: ... > when I run my example, an error shows: > "NameError: global name'menubar' is not defined" > > I wonder why it doesn't work. Isn't that the way to define an object > variable? The code you posted should not trigger this error. Most likely problem: you

Re: confusion between global names and instantiated object variable names

2005-10-14 Thread wanwan
oops, of course. Very careless mistake. thx -- http://mail.python.org/mailman/listinfo/python-list

Re: confusion between global names and instantiated object variable names

2005-10-14 Thread Piet van Oostrum
> "wanwan" <[EMAIL PROTECTED]> (w) wrote: >w> I'm trying to make a GUI, but for some of the instantiated object >w> variable names, the interpreter is looking at them as global names. >w> Here is an example of what I did: >w> class mygui: >w> def __init__(self, root): >w>