Created
September 30, 2013 08:48
-
-
Save fnielsen/6761017 to your computer and use it in GitHub Desktop.
Tkinter Hello world in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Tkinter import * | |
def hello(): | |
"""Callback function for button press.""" | |
print "Hello World" | |
# Main root window | |
root = Tk() | |
# A button with a callback function | |
Button(root, text="Press here", command=hello).pack() | |
# .pack() method is necessary to make the button appear | |
# Event loop | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment