Skip to content
Sign upLog in
← Back to Community

[Python (with Turtle)] Why am I getting an error?

Profile icon
Babbel

I wanted to create a small turtle game.
But if I try to change the shape size I get an error:

Cannot infer image mime type

Is the interpreter broken or is there another reason?
The Turtle class definitely has a method 'shapesize()'.

Here's my code: https://repl.it/@Babbel/Python-Turtle-Error

Voters
Profile icon
silschouten
Profile icon
Babbel
Comments
hotnewtop
Profile icon
kowusu

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.

Profile icon
ColePete

@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

Profile icon
E-Sheep

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.

Profile icon
baco

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

Profile icon
Four_Of_Clubs

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