from tkinter import *
root = Tk()
def hello():
print('hello')
# it cannot open menu
menubar = Menu(root)
menubar.add_command(label="hello",command=hello)
menubar.add_command(label="quit",command=root.quit)
root.config(menu=menubar)
root.mainloop()
大神幫忙看看啊