Ask coding questions

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

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!

kpetzak (2)

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

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

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.

Wilke000 (625)

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

kowusu (0)

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.

fabianbergstrom (1)

has anyone found a solution to this problem yet?