Skip to content
← Back to Community
Python (with Turtle) mode method
Profile icon
lbrtlvy

Hi all,
why does the lines:

import turtle
window = turtle.Screen()
window.mode("logo")

return the error:

AttributeError: 'Screen' object has no attribute 'mode' on line 3

Please help...

Tnx

Voters
Profile icon
lbrtlvy
Comments
hotnewtop
Profile icon
[deleted]

Same problem. These are the methods available in repl.it's turtle:
['init', 'module', 'back', 'backward', 'begin_fill', 'bk', 'circle', 'clear', 'clone', 'color', 'degrees', 'delay', 'distance', 'done', 'dot', 'down', 'end_fill', 'fd', 'fill', 'fillcolor', 'forward', 'getpen', 'getscreen', 'getturtle', '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']

Profile icon
CoolqB

Because the object turtle.Screen() doesn't have the method mode(). After reading through the documentation I found that the turtle class does. Have you tried turtle.mode()?

Profile icon
lbrtlvy

@CoolqB tnx for answering, but i did try and it end with the same result:

import turtle
window = turtle.Screen()
batz = turtle.Turtle()
batz.mode("logo")
batz.shape("turtle")

btw, the method mode() is a method of TurtleScreen/Screen and in idle it work!

Profile icon
CoolqB

@lbrtlvy This is probably because the Reply.it version doesn't have all the features of the Turtle module you'll find in Python. Repl.it's Python (with Turtle) language is using Skulpt, which is a Python implementation using JavaScript. This means that the Turtle you're using is not the same one found in Python (or you call it IDLE, which is actually the editor, not the language ;) ), it is in fact a rewritten version with perhaps not all the same features you're used to.