This is where the error is found:
global backbuttonimg
backbuttonimg = PhotoImage(file=\"backbutton.gif\")
C6 = tkinter.Button(W_CheckDates, image=backbutton
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.
Adding this for anyone who has tried the above with no success. If you have an erroneous path when running the script in some environments the path to the file is retained. I commented out everything from where I first use PhotoImage up to the window mainloop, run the script, close resulting gui, uncomment the code, run, and it shows the image as expected.