from tkinter import *
from tkinter import messagebox
#messagebox不可以用*号导入
# 因为它不在init列表里,
# 在init列表里的才可以用*导入
root = TK()
btn01=Button(root)
btn01["text"]="give you flower"
btn01.pack()
def songhua(e):e是事件对象
messagebox.showinfo("Message","i want to give you flowers")
print("all flowers for you")
btn01.bind("<Button-1>",songhua)
root.mainloop()
root.mainloop() #调用组件的mainloop()方法,进入事件循环
C:\Users\pcl\venv\Scripts\python.exe "C:/Users/pcl/.1aPython all exercise/GUI/1.py"
File "C:\Users\pcl\.1aPython all exercise\GUI\1.py", line 14
messagebox.showinfo("Message","songnihua")
IndentationError: unexpected indent
Process finished with exit code 1
老师这是怎么回事 照着视频打的