need help using Tkinter

Manzur Ahmed dearmanzur at gmail.com
Tue Jul 28 17:17:25 CEST 2009


i wanted to ask you if one of you could help me to use Tkinter. i'm trying
to just create a simple GUI for which I have provided the code for below.

# Simple GUI
# Demonstrates creating a window

from Tkinter import *

# create the root window
root = Tk ()

# modify the window
root.title("Simple GUI")
root.geometry("200x100")

# kick off the window's event loop
root.mainloop()

i saved the file as both simple_gui.py and simple_gui.pyw. when i try to run
simple_gui.pyw i don't get anything and when i try to run simple_gui.py i
get the following:
Traceback (most recent call last):
File "C:\Python-Study\Chapter10\simple_gui.py", line 4, in <module>
ImportError: No module named Tkinter

i tried to google search this and there were some threads that were saying
to install tcl but that does not work. I did check the Lib directory under
the Python directory and I did not see a Tkinter module anywhere which I
think is the problem. Do you know how I would go about with getting this
module and if that is not the problem or if you think it might be caused by
something else, can you please give me some guidance? i even reinstalled
python 3.1 which i got from www.python.org.  i still do not see the Tkinter
module in the lib directory.  thank you for all your help.

manzur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090728/f14cc879/attachment.html>


More information about the Python-list mailing list