5

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?

ggorlen
  • 44,755
  • 7
  • 76
  • 106
Mamunur Rashid
  • 1,095
  • 17
  • 28

1 Answers1

5

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.

cdlane
  • 40,441
  • 5
  • 32
  • 81