我使用的是Python,我经常遇到这样的分段错误

2024-04-19 03:06:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在做一个记事本,我不断地得到一个错误的代码。。。我的代码有问题吗

from tkinter import *

root = Tk()
root.title("Instem 메모장")
root.geometry("640x480")


root.resizable(True, True) 

def create_new_file():
    print("새파일을 만듭니다.")

menu = Menu(root)

menu_file = Menu(menu, tearoff=0)
menu_file.add_command(label="파일", command=create_new_file)



menu.add_cascade(label="메뉴", menu=menu)

root.config(menu=menu)
root.mainloop()