我有这个密码
from tkinter import *
fenetre = Tk()
fenetre.mainloop()
他们不使用VSCodium,但可以很好地使用VSCode。 我只是在这两个版本上都添加了微软的扩展名“Python”,没有更多,也没有更少
有人知道为什么? 我个人更喜欢使用Codium
从VSCodium启动时,我进入了终端:
andres@andres-linux:~$ /usr/bin/python3 /home/andres/Bureau/CoursEPSI/Python/hello.py
Traceback (most recent call last):
File "/home/andres/Bureau/CoursEPSI/Python/hello.py", line 1, in <module>
from tkinter import *
File "/home/andres/Bureau/CoursEPSI/Python/tkinter.py", line 3, in <module>
fenetre = tk()
NameError: name 'tk' is not defined
使用VSCode,没有问题,它会打开一个窗口
试试这个
另外,在仔细查看了错误行之后
我认为您需要将
tk
更改为Tk
,即fenetre = tk()
更改为fenetre = Tk()
相关问题 更多 >
编程相关推荐