0

I a having trouble with the Turtle module in Python an error keeps occurring Turtle' object has no attribute 'shapesize I want to change the size of my Turtle sprite

This is my code

import turtle
my_turtle = turtle.Turtle()
my_turtle.shapesize(1)

I am using repl.com as my IDE

Does anyone know why this isn't working?

cdlane
42.2k5 gold badges37 silver badges87 bronze badges
asked Mar 14, 2020 at 12:18
1
  • 1
    The code is fine, you might want to run it locally and not on an online IDE. Commented Mar 14, 2020 at 13:00

1 Answer 1

1

Repl.com supplies their own turtle.py library that isn't the one that comes with Python. This library has half the symbols of the standard one and does not include shapesize nor it's synonym turtlesize.

Available symbols and aliases include:

['Screen', 'Turtle', 'back', 'backward', 'begin_fill', 'bk', 'bye', 'circle',
'clear', 'clone', 'color', 'degrees', 'delay', 'distance', 'done', 'dot', 'down',
'end_fill', 'fd', 'fill', 'fillcolor', 'forward', 'getpen', 'getscreen',
'getturtle', 'goto', 'heading', 'hideturtle', 'home', 'ht', 'isdown',
'isvisible', 'left', 'lt', 'mainloop', 'onclick', 'ondrag', 'onrelease', 'pd',
'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position', 'pu', 'radians',
'reset', 'right', 'rt', 'seth', 'setheading', 'setpos', 'setposition',
'setundobuffer', 'setx', 'sety', 'shape', 'showturtle', 'speed', 'st', 'stamp',
'towards', 'tracer', 'undo', 'undobufferentries', 'up', 'update', 'width',
'window_height', 'window_width', 'write', 'xcor', 'ycor']

Missing symbols and aliases include:

['Canvas', 'Pen', 'RawPen', 'RawTurtle', 'ScrolledCanvas', 'Shape',
'TurtleScreen', 'Vec2D', 'addshape', 'begin_poly', 'bgcolor', 'bgpic',
'clearscreen', 'clearstamp', 'clearstamps', 'colormode', 'end_poly',
'exitonclick', 'filling', 'get_poly', 'get_shapepoly', 'getcanvas', 'getshapes',
'listen', 'mode', 'numinput', 'onkey', 'onkeypress', 'onkeyrelease',
'onscreenclick', 'ontimer', 'pen', 'register_shape', 'resetscreen',
'resizemode', 'screensize', 'settiltangle', 'setup', 'setworldcoordinates',
'shapesize', 'shapetransform', 'shearfactor', 'textinput', 'tilt',
'tiltangle', 'title', 'turtles', 'turtlesize']
answered Mar 14, 2020 at 18:29
Sign up to request clarification or add additional context in comments.

1 Comment

thankyou. Is there any way I could import these or would I have to use another IDE?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.