我想在单击“x”和“x1”按钮时打开的窗口中添加文本。但我想不通。
import tkinter as tk
from tkinter import *
def create_window():
window = tk.Toplevel(root)
root = tk.Tk()
root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(), root.winfo_screenheight()))
b = tk.Button(root, text="x", command=create_window)
b.pack(side=TOP, anchor=W, fill=BOTH, expand=YES)
b1 = tk.Button(root, text="x1", command=create_window)
b1.pack(side=TOP, anchor=W, fill=BOTH, expand=YES)
root.mainloop()