Here is my code:
import os
from turtle import *
sc = Screen()
sc.setup(600,600)
image = os.path.expanduser("~\OneDrive\Desktop\AlienGameImage.gif")
sc.register_shape(image)
t = Turtle()
t.shape(image)
sc.exitonclick()
Whenever I run this program, the first time it comes up with this error (Error below). However, the second time I run it, it runs fine. Error:
Traceback (most recent call last):
File "C:\Users\hulks\.spyder-py3\untitled0.py", line 14, in <module>
t = Turtle()
File "C:\Users\hulks\anaconda3\lib\turtle.py", line 3813, in __init__
RawTurtle.__init__(self, Turtle._screen,
File "C:\Users\hulks\anaconda3\lib\turtle.py", line 2557, in __init__
self._update()
File "C:\Users\hulks\anaconda3\lib\turtle.py", line 2660, in _update
self._update_data()
File "C:\Users\hulks\anaconda3\lib\turtle.py", line 2646, in _update_data
self.screen._incrementudc()
File "C:\Users\hulks\anaconda3\lib\turtle.py", line 1292, in _incrementudc
raise Terminator
Terminator
The error comes from here in turtle.py:
def _incrementudc(self):
"""Increment update counter."""
if not TurtleScreen._RUNNING:
TurtleScreen._RUNNING = True
raise Terminator
if self._tracing > 0:
self._updatecounter += 1
self._updatecounter %= self._tracing
I don't want to have to run this code twice every time so if anyone has a solution, I thank you in advance.
turtle.py, line 1292 your code is raising the exception. You need to look here and see why it is doing it.