Created
October 1, 2012 10:37
-
-
Save fnielsen/3810836 to your computer and use it in GitHub Desktop.
Tkinter simple example
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