0

in python3.8 i am trying to have multiple turtle go off in different directions but whenever i execute the bellow code

import turtle

ivan = turtle.Turtle()
amy = turtle.Turtle()

ivan.forward(50)
ivan.left(90)
ivan.forward(20)

amy.right(90)
amy.forward(100)

the terminal spits this out after opening the turtle window

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 4, in <module>
  File "/usr/lib/python3.8/turtle.py", line 3814, in __init__
    RawTurtle.__init__(self, Turtle._screen,
  File "/usr/lib/python3.8/turtle.py", line 2558, in __init__
    self._update()
  File "/usr/lib/python3.8/turtle.py", line 2661, in _update
    self._update_data()
  File "/usr/lib/python3.8/turtle.py", line 2647, in _update_data
    self.screen._incrementudc()
  File "/usr/lib/python3.8/turtle.py", line 1293, in _incrementudc
    raise Terminator
turtle.Terminator

any help?

  • No `raise Terminator` on my system ( Python 3.9 ). This is not really a problem. The Terminator is raised e.g. when you close the Turtle window when the script is still running. Don't worry about that. It's not an ERROR message ... only a hint, that you didn't handle closing the window in your code. It's not a problem though. – Claudio Jun 22 '22 at 11:20

1 Answers1

0

Try THIS:

import turtle

ivan = turtle.Turtle()
amy  = turtle.Turtle()

ivan.forward(50)
ivan.left(90)
ivan.forward(20)

amy.right(90)
amy.forward(100)

turtle.mainloop()
Claudio
  • 7,474
  • 3
  • 18
  • 48