In Python 3+, I am trying to run turtle.setup(400, 500)
but it is not working.
There is no reference named setup
.
How can I use the screen setup in Python 3?
In Python 3+, I am trying to run turtle.setup(400, 500)
but it is not working.
There is no reference named setup
.
How can I use the screen setup in Python 3?
There are (at least) three options depending on how you import turtle. Going from worst to best:
Option 1:
from turtle import *
setup(400, 500)
Option 2:
import turtle
turtle.setup(400, 500)
Option 3:
from turtle import Turtle, Screen
screen = Screen()
screen.setup(400, 500)
If these don't work for you, then update your question with more information about the environment under which you're running Python/turtle.