Dec-02-2019, 12:51 PM
Hi,
I've been trying to figure out what I need to edit in this code to make it run properly. I wasn't sure where to post this in the forums so just decided to make a new post. Any help with this is definitely appreciated.
I've been trying to figure out what I need to edit in this code to make it run properly. I wasn't sure where to post this in the forums so just decided to make a new post. Any help with this is definitely appreciated.
from Tkinter import * # import everything from the Tkinter GUI framework def calculate_age() # calculate the pay and display global age# global variable called pay e1.focus_set( e2=Label(master, text="No Age Calculated ").grid(row=2,column=0) days= 365*float(e1.get() e2=Label(master, text=" ".grid(row=2,column=0) e2=Label(master, text="Age in days is +str(days)).grid(row=2,column=0 e1.delete(0,'end') def close_window() # close menu window and stop program master.destroy() master = Tk( Label(master, text="Enter your age in years:").grid(row=0) Label(master, text="Your age in days is ").grid(row=2) e1 = Entry(master) e2 = Label(master) e1.grid(row=0, column=1) e2.grid(row=1, column=1 # Buttons Button(master, text='Calc', command=calculate_age).grid(row=4, column=1, sticky=W, pady=4) Button(master, text='Quit', command=close_window).grid(row=4, column=0, sticky=W, pady=4) Master.geometry("350,200" master.title("AssessErrors") #mainloop( ) Master.destroy()