Ask coding questions

← Back to all posts
Turtle python resizing
Four_Of_Clubs (86)

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: '<invalid type>' object has no attribute 'turtlesize' on line 40" or similar. If any of you know what I am missing, please fill me in. Thanks!

Commentshotnewtop
kpetzak (2)

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!

MichaelHutts (1)

@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.

fabianbergstrom (0)

has anyone found a solution to this problem yet?