Created
February 1, 2015 00:21
-
-
Save KatrinaHoffert/9d109623c44a620b10b1 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python 1 | |
import Tkinter as tk 2 | |
class Application(tk.Frame): 3 | |
def __init__(self, master=None): | |
tk.Frame.__init__(self, master) 4 | |
self.grid() 5 | |
self.createWidgets() | |
def createWidgets(self): | |
self.quitButton = tk.Button(self, text='Quit', | |
command=self.quit) 6 | |
self.quitButton.grid() 7 | |
app = Application() 8 | |
app.master.title('Sample application') 9 | |
app.mainloop() 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may have to specificate your version of python, in fact, Tkinter is specifical to Python 2.6 and less.
But to pyhton3 the library's name is tkinter, (and not Tkinter).
So, it's better to use the last version of python, that is to say python3.