使用tkinter,为什么我在第五个页面加入的图片和第一个页面的图片一块出现而且点击第一个页面的内容第五个页面就直接消失了
这是页面一:
root = Tk()
root.title("mbti十六型人格测试")
root.geometry("800x800")
root.configure(bg="AntiqueWhite")
image = Image.open(r"C://Users//29212//Desktop//mbti1.jpg")
zoom = 1.8
pixels_x, pixels_y = tuple([int(zoom * x) for x in image.size])
img = ImageTk.PhotoImage(image.resize((600, 400)))
label = Label(root, image=img)
label.image = img
label.pack()
这是页面五:
image = Image.open(r"C:\Users\29212\Desktop\results.jpg")
zoom = 1.8
pixels_m, pixels_n = tuple([int(zoom * x) for x in image.size])
img = ImageTk.PhotoImage(image.resize((600, 400)))
label = Label(fifth, image=img)
label.image = img
label.pack()
image = Image.open(r"C:\Users\29212\Desktop\results2.jpg")
zoom = 1.8
pixels_x, pixels_y = tuple([int(zoom * x) for x in image.size])
img = ImageTk.PhotoImage(image.resize((600, 400)))
label = Label(fifth, image=img)
label.image = img
label.pack()
运行结果: