Oct-27-2016, 04:47 PM
I'm a new programmer who started python last month and tkinter today. I've got a problem with my code and im not sure whats up with it.
from tkinter import * selection = Tk() selection.title("Select Calculator") op2 = StringVar() def op(): op = int(op2.get()) return label1 = Label(selection,text="Select 1 for Newton's Laws of Motion Calculator") label2 = Label(selection,text="Select 2 for Momentum Calculator") label3 = Label(selection,text="Select 3 for Impulse Calculator") label1.grid(row=0,column=1,sticky=W) label2.grid(row=1,column=1,sticky=W) label3.grid(row=2,column=1,sticky=W) enter = Entry(selection,textvariable=op2) enter.grid(row=3,column=1) select = Button(selection,text="Continue",command=op) select.grid(row=3,column=2) selection.mainloop() if op == 1: print("Hi")I'd really appreciate some help and advice.