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
-
1The code is fine, you might want to run it locally and not on an online IDE.Edoardo Guerriero– Edoardo Guerriero2020年03月14日 13:00:01 +00:00Commented Mar 14, 2020 at 13:00
1 Answer 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
cdlane
42.2k5 gold badges37 silver badges87 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
yt.
thankyou. Is there any way I could import these or would I have to use another IDE?
lang-py