there is a python programe in c:\workspace\trutle.py,
i can run it in the python command line console,
when i open a cmd window, input python c:\workspace\trutle.py,
i get the wrong output
Traceback (most recent call last):
File "c:\workspace\turtle.py", line 1, in <module>
import turtle
File "c:\workspace\turtle.py", line 3, in <module>
turtle.speed(1)
AttributeError: 'module' object has no attribute 'speed'
what is the reason? how to solve it?
import turtle
from random import randint
turtle.speed(1)
turtle.color("grey")
x=-80
for y in range(-80,80+1,10):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.forward(160)
y=80
turtle.right(90)
for x in range(-80,80+1,10):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.forward(160
turtle.pyortrutle.py? If it's namedturtle, then when you doimport turtleit will try to import itself. Name it something else besides a standard lib name.