简体   繁体   中英

I'm trying to write a code but i got this error

I am trying to figure it out what problem is it. code

from tkinter import *

compiler = tkinter()
editor = Text()
editor.pack()
compiler.mainloop()

error

 compiler = tk()
NameError: name 'tk' is not defined```

Write Tk() instead of tk() it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM