Created
February 1, 2013 10:14
-
-
Save walterrenner/4690491 to your computer and use it in GitHub Desktop.
Basic Python GUI
This file contains 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
#!/usr/bin/env python | |
from Tkinter import * | |
import tkMessageBox | |
from datetime import datetime | |
pressed = 0 | |
def helloCallBack(): | |
global pressed | |
pressed += 1 | |
tkMessageBox.showinfo("Hello Python", "its %ssand you pressed me %i times" % (str(datetime.now()), pressed)) | |
root = Tk() | |
helloButton = Button(root, text="Hello", width=60, command=helloCallBack) | |
quitButton = Button(root, text="Quit", width=60, command=quit) | |
helloButton.pack() | |
quitButton.pack() | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment