[Tutor] Global name not found, though clearly in use

Nitin Pawar nitinpawar432 at gmail.com
Wed Jul 14 16:31:47 CEST 2010


>From the logs looks like the variable is not initiated when it was used.

If I read it correct, you said it down ... that means below the line where
the error came? and if they belong to same function then this error is valid

Thanks,
Nitin

On Wed, Jul 14, 2010 at 7:48 PM, Corey Richardson <kb1pkl at aim.com> wrote:

> Hey tutors. Two separate submissions one day, guess I'm getting busy ;)
>
> Anyway, I'm re-writing my hangman program to make use of my new-found
> understanding of OOP, and using a GUI this time around. I decided on coding
> with Tkinter, to get my feet wet with GUI stuff.
> Here is the traceback:
>
> Traceback (most recent call last):
>  File "C:\Python31\lib\tkinter\__init__.py", line 1399, in __call__
>   return self.func(*args)
>  File "C:/Users/Corey/Desktop/HangmanApp.py", line 45, in getLetter
>   self.guess = eWordEntryBox.get()
> NameError: global name 'eWordEntryBox' is not defined
>
> However, not even 30 lines down, (29, to be exact) there is this line:
>   eWordEntryBox = tk.Entry(fWordEntry)
>
> Not understanding what is happening here. Same happens when I tack self at
> the beginning of it, except it says global name self is not defined.
>
> Thanks!
> ~Corey Richardson
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Nitin Pawar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100714/96df4e98/attachment.html>


More information about the Tutor mailing list