Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Errors in code
#1
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.


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()
Reply


Messages In This Thread
Errors in code - by coolcassie - Dec-02-2019, 12:51 PM
RE: Errors in code - by DreamingInsanity - Dec-02-2019, 03:18 PM
RE: Errors in code - by coolcassie - Dec-03-2019, 12:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Are there errors in the code for my coin toss systems? Matlibplot is too perfect . Coolkat 0 376 Nov-13-2023, 11:54 AM
Last Post: Coolkat
  My code won't say Player wins or computer wins. No errors. its_a_meLuigi64 2 1,627 Dec-01-2021, 04:43 PM
Last Post: its_a_meLuigi64
  Rmarkdown opened by python code - errors Rav013 0 2,092 Apr-27-2021, 03:13 PM
Last Post: Rav013
  [split] Kera Getting errors when following code example Image classification from scratch hobbyist 3 4,621 Apr-13-2021, 01:26 PM
Last Post: amirian
  2 errors in code numbnumb54 2 2,026 Jul-24-2020, 02:28 PM
Last Post: Marbelous
  Code errors rhyjom 0 1,462 Jun-21-2020, 04:50 PM
Last Post: rhyjom
  Errors trying to run code ziggyztz 3 3,664 Nov-03-2019, 04:24 AM
Last Post: newbieAuggie2019
  errors in code sylvie1987100 3 2,312 Sep-11-2019, 12:54 PM
Last Post: sylvie1987100
  Decorator toy code throws syntax errors kevinxhi 3 3,572 Sep-04-2017, 03:01 AM
Last Post: kevinxhi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020