[Tutor] Another question about GUI applications.

Alan Gauld alan.gauld at btinternet.com
Wed Nov 9 01:26:00 CET 2011


On 08/11/11 22:41, Steven D'Aprano wrote:
> Nathaniel Trujillo wrote:
>
>> Traceback (most recent call last):
>> File "C:\Python31\mad_lib.py.py", line 112, in <module>
>> root = Tkinter.Tk()
>> NameError: name 'Tkinter' is not defined
>
> You have to import the Tkinter module first:


And since you seem to be using Python v3 its spelled

import tkinter

in lowercase...

Also:

root = Tkinter.Tk()
root.iconbitmap(default=ico_image_filename)

ico_image_filename

is a variable which you will need to define with
a real filename.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list