[Tkinter Example] Hello World very basic

Post here if you need help with creating a Graphical User Interface in Python.

[Tkinter Example] Hello World very basic

Postby Yoriz » Sat Feb 09, 2013 2:12 pm

Code: Select all
import Tkinter

root = Tkinter.Tk()
root.title('Hello World')
app = Tkinter.Frame(master=root)

app.mainloop()
root.destroy()
Last edited by Yoriz on Tue Mar 19, 2013 1:03 pm, edited 1 time in total.
Reason: Added Example to the title
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 832
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Hello World very basic example

Postby wuf » Sat Feb 09, 2013 5:24 pm

Here an other basic example:
Code: Select all
try:
    #~~ For Python 2.x
    import Tkinter as tk
except ImportError:
    #~~ For Python 3.x
    import tkinter as tk

app_win = tk.Tk()
app_win.title('Hello World')
app_frame = tk.Frame(app_win)
app_win.mainloop()

wuf ;)
wuf
 
Posts: 38
Joined: Fri Feb 08, 2013 6:42 am


Return to GUI

Who is online

Users browsing this forum: No registered users and 1 guest