After runing below code, got below error.
How to colse the Toplevel window after clicking the button in my Python v3.6.5?
Thanks for any help or suggestion.
How to colse the Toplevel window after clicking the button in my Python v3.6.5?
Thanks for any help or suggestion.
Error:_tkinter.TclError: bad window path name ".!toplevel"
def mdfNames(mdf): mdf.destroy() def mdfPanel(): mdf = tkinter.Toplevel() mdfSize = 220 mdf.geometry('%dx%d+%d+%d' % (mdfSize, mdfSize, (mdf.winfo_screenwidth()-mdfSize)/2, (mdf.winfo_screenheight()-mdfSize)/2)) tkinter.Button(mdf, text = "Start", command=mdfNames(mdf), justify = tkinter.CENTER).grid(row=7,column =1, columnspan =2)