简体   繁体   English

更改蟒蛇大小

[英]Change python turtle size

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我在 Python 中的 Turtle 模块遇到问题,错误不断发生Turtle' object has no attribute 'shapesize我想更改我的 Turtle sprite 的大小

This is my code这是我的代码

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

I am using repl.com as my IDE我使用 repl.com 作为我的 IDE

Does anyone know why this isn't working?有谁知道为什么这不起作用?

Repl.com supplies their own turtle.py library that isn't the one that comes with Python. Repl.com 提供了他们自己的turtle.py 库,该库不是Python 自带的。 This library has half the symbols of the standard one and does not include shapesize nor it's synonym turtlesize .这个库有标准符号的一半,不包括shapesize也不包括同义词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']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM