[Tutor] Do I have to initialize TKInter before I can use it?

Alan Gauld alan.gauld at freenet.co.uk
Tue Nov 15 05:34:56 CET 2005


> I am having problems. The latest error message I got was:
>    tkMessageBox.showinfo("Hockey",
> NameError: name 'tkMessageBox' is not defined

A NameError means Python doesn't recognise the name.
Usually that's because either you didn't declare the variable or 
you forgot to import the module or you spelled it wrong.

In this case I'd guess you forgot the import?

Python error messages are really quite helpful if you just stop
and think about what they are saying for a few minutes.

Alan G
Author of the learn to program web tutor

More information about the Tutor mailing list