'image “pyimage2” doesn't exist'?

后端 未结 2 1785
失恋的感觉
失恋的感觉 2021-01-01 04:49

This is where the error is found:

global backbuttonimg
backbuttonimg = PhotoImage(file=\"backbutton.gif\")
C6 = tkinter.Button(W_CheckDates, image=backbutton         


        
2条回答
  •  生来不讨喜
    2021-01-01 05:13

    Ok so you say that the login function works once, then it can't work again. Here the problem can be solved using tk.Toplevel() instead of tk.Tk() see: why python photoimages don't exist? and tkinter.TclError: image "pyimage3" doesn't exist

    These threads mention how you can't have two instances of Tk() running simultaneously, you have to use Toplevel() instead.

    Why did these threads not apply to you (i think they do...)? But just a tip, if you state that they don't apply to you, then give reasons why, it helps make your question clearer. Also, add the full traceback when your question is about a particular error.

    Hope this helps a bit.

提交回复
热议问题