Discuss / Python / 一直在报错是为啥

一直在报错是为啥

Topic source

西山脚

#1 Created at ... [Delete] [Delete and Lock User]
PS D:\codeHeaven\python> python .\turtle.py
Traceback (most recent call last):
  File ".\turtle.py", line 2, in <module>
    from turtle import *
  File "D:\codeHeaven\python\turtle.py", line 5, in <module>
    width(4)
NameError: name 'width' is not defined

第二个报错还勉强可以看懂,第一个完全找不到头绪,turtle也安装了

西山脚

#2 Created at ... [Delete] [Delete and Lock User]

自己把坑填上,千万不要把文件名取名叫 turtle 。。。

祁佚

#3 Created at ... [Delete] [Delete and Lock User]

我和你一样。。。哈哈 命名不能叫 turtle.py,否则要报错啊

自相似__

#4 Created at ... [Delete] [Delete and Lock User]

我也是,为什么呢

因为你们的from turtle import *


  • 1

Reply