Skip to content
← Back to Community
Turtle python resizing
Profile icon
Four_Of_Clubs

I want to change the size of my turtles in python, but can't seem to figure it out. I've tried " turtle.resizemode("user") " which returns an error, along with "t.shapesize(2,2)" and " t.turtlesize(2,2)" with t = turtle, but I just keep getting the error "AttributeError: '' object has no attribute 'turtlesize' on line 40" or similar. If any of you know what I am missing, please fill me in. Thanks!

Voters
Profile icon
OliverCzacho
Profile icon
1MrJohnson
Profile icon
Wilke000
Profile icon
kpetzak
Profile icon
18sammondse
Profile icon
PedroSales
Profile icon
SriramSivakuma2
Profile icon
JohnHe2
Profile icon
codemaster12345
Profile icon
DavidHayes3
Comments
hotnewtop
Profile icon
silschouten

same

Profile icon
kpetzak

So, repl.it uses an open source technology called Skulpt to run Python code in a browser.

http://skulpt.org/

It seems repl.it communicates with Skupt through an API. I found the Turtle API documentation here:

http://www.pythononline.ch/pyonline/progs/doc/skulptturtle.pdf

If you look through the API documentation you will see that the turtle.shape method is included, but some of the other sizing methods like turtle.resizemode & turtle.shapesize are not included in the documentation. This is why we could change the shape and it wouldn't give us an error but it would for the other methods.

So, this seems to be a lack of functionality in the API. Skulpt being open source, I guess we could add it if we had the ambition!

Profile icon
MichaelHutts

@kpetzak I've been looking everywhere for some type of documentation on the capabilities of turtle here. Thanks for this info. A lot easier trial and error seeing what works and what doesn't.

Profile icon
Wilke000

You taught me @MichaelHutts, I am @IndyCarter, and I have many posts 😉

Profile icon
fabianbergstrom

has anyone found a solution to this problem yet?

Profile icon
SriramSivakuma2

same

Profile icon
JohnHe2

same

Profile icon
kowusu

Using python with pygame (instead of python with turtle) seems to solve the issue. So if you put the same turtle code that works on a regular IDE into python with pygame, there are no longer any issues with shapesize and resizemode.

Profile icon
KristyHagan

Thank you! Worked like a charm. @kowusu

Profile icon
Maxwarlock1101

@kowusu replit decided it's time to make everything inconvenient and has limited turtle functionality entirely to Python with Turtle, Pygame just gives errors.

Profile icon
kpetzak

same