Ask coding questions

← Back to all posts
[Python (with Turtle)] Why am I getting an error?
Babbel (64)

I wanted to create a small turtle game.
But if I try to change the shape size I get an error:
Is the interpreter broken or is there another reason?
The Turtle class definitely has a method 'shapesize()'.

Here's my code:

kowusu (0)

Python with pygame seems to work better with turtle than python with turtle. Although adding the '=' works, I still had issues. However, with the pygame library, turtle had no issues.

ColePete (30)

@Babbel I think I fixed it!

import turtle

s = turtle.Screen()

t = turtle.Turtle()
t.shapesize = (2, 2)

All you had to do was add an = sign

YuAndy (74)

turtle.shapesize()does exist, but I don't think you could do that in REPL for some reason. You can try screen=turtle.Screen() and then type in the coordinates of every angle in the shape using register_shape. For example screen.register_shape((10,10),(-10,10),(-10,-10),(10,-10)) will create a 20x20 square. With that you could create bigger shapes.

baco (0)

(I ran this code on my laptop without error...(?))

Four_Of_Clubs (96)

I had the same problem. I still don't know If you can change the size of turtles on here.