Error one: do not display pictures
photo = PhotoImage(file='E:\\bg2.gif')
lbi = Label(windows, image = photo)
lbi.grid(row=0, columnspan = 2)
Solution:
Plus global
global photo
photo = PhotoImage(file='E:\\bg2.gif')
lbi = Label(windows, image = photo)
lbi.grid(row=0, columnspan = 2)
错误二:_tkinter.TclError: image "pyimage1" doesn't exist
Only one root window can exist in a program, that is to say, only one Tk () can exist, and other windows can only exist in the form of top-level windows (Toplevel ())
Solution:
Change Tk () to Toplevel ()