faqts : Computers : Programming : Languages : Python : Snippets : Tkinter

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 3 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

Hello world in Tkinter (was: GUI's)

Jul 5th, 2000 10:00
Nathan Wallace, unknown unknown, Hans Nowak, Snippet 173, Alan Gauld


"""
Packages: gui.tkinter
"""
"""
> I was wondering how you could make a GUI python program for 
Windows 95
Tkinter comes with Python.
SpecPython is an addon to SpecTCL, a GUI builder for Tk/Java
JPython implements the JAVA AWT (and Swing?) in Python
Either approach will create a GUI running in Python.
There are a couple of Tkinter tutorials on the Web.
I personally prefer this one:
http://www.pythonware.com/library/tkinter/introduction/index.htm
Here's Python/Tkinter's minimal Hello world:
"""
#-----------------------
# pull in all the widget names
from Tkinter import *
# create a label widget and add it to the root window
w = Label(0, text="Hello, world!") # 0 => no parent window
w.pack()
# start processing user events
w.mainloop()
#-----------------------