This probably is really basic, but here goes...
I'm trying to learn python by reading books and checking online resources and doing OK so far. My next step is to put a small graphical wrapper around what I'm doing.
So far, I've got this:
Code: Select all
#!/usr/bin/env python
#Import anything necessary
from tkinter import *
#define some functions
def OKaction():
print('Pressed OK')
def Quitaction():
print('Pressed Quit')
window = Tk()
window.title("Control Panel")
buttonOK=Button(window, text="OK", command = OKaction)
buttonOK.pack()
buttonQuit=Button(window, text="Quit", command = Quitaction)
buttonQuit.pack()
mainloop()
can someone tell me what's happening and how toi fix it so I can run my code from the command line?
Thanks
Paul