问题
I'm trying to make a turtle game on Repl.it and I don't know why this error keeps coming up. Here is my code:
import turtle
wn = turtle.Screen()
wn.bgcolor("white")
wn.setup(width=800, height=800)
wn.tracer(0)
# Set up the ground
ground = turtle.Turtle()
ground.color("white")
ground.shape("square")
ground.speed(0)
ground.shapesize(stretch_wid=200, stretch_len=20)
ground.speed(0)
ground.color("black")
ground.penup()
ground.goto(0, -400)
ground.direction = "stop"
回答1:
It seems that the implementation of the turtle library on repl.it is somewhat limited and not all commands are available. You can either run it locally to use all commands or remove incompatible commands.
Source: https://repl.it/talk/ask/Turtle-python-resizing/7312
回答2:
I also had this problem You can use Python with pygame instead of python with turtle because for some reason, it works
来源:https://stackoverflow.com/questions/60961758/attributeerror-turtle-object-has-no-attribute-shapesize-on-line-14