0

Can't invoke "entry" command : application has been destroyed.

How to solve this problem The code is from tkinter import * from math import factorial import parser root = Tk() root.title('Calculator') root.mainloop() display = Entry(root) display.grid(row=1, columnspan=6, sticky=N+E+W+S) Button(root,text="1", command=lambda :get_variables(1)).grid(row=2,column=0, sticky=N+S+E+W) Button(root,text=" 2", command=lambda :get_variables(2)).grid(row=2,column=1, sticky=N+S+E+W) Button(root,text=" 3", command=lambda :get_variables(3)).grid(row=2,column=2, sticky=N+S+E+W) Button(root,text="4", command=lambda :get_variables(4)).grid(row=3,column=0, sticky=N+S+E+W) Button(root,text=" 5", command=lambda:get_variables(5)).grid(row=3,column=1, sticky=N+S+E+W) Button(root,text=" 6", command=lambda :get_variables(6)).grid(row=3,column=2, sticky=N+S+E+W) Button(root,text="7", command=lambda :get_variables(7)).grid(row=4,column=0, sticky=N+S+E+W) Button(root,text=" 8", command=lambda :get_variables(8)).grid(row=4,column=1, sticky=N+S+E+W) Button(root,text=" 9", command= lambda :get

16th Feb 2021, 5:26 PM
Vaibhav Tanwar
Vaibhav Tanwar - avatar
1 Answer
0
had the same trouble with the same code hahaha, the issue was that root.mainloop() was before the entry command, make sure to put the mainloop in the end of the code, otherwise you are executing the program without all the info
6th Apr 2021, 10:39 PM
FabiĂĄn Esteban
FabiĂĄn Esteban - avatar