@VB2007

Почему в Pyton 3.4.4 при использовании модуля turtle выводится ошибка «raise Terminator»?

Пишу легенькую "Рисовашку" с turtle, почему-то начала выводиться ошибка "raise Terminator"
Полный текст ошибки:
Traceback (most recent call last):
File "C:\*полный путь я убрал))\*название файла я тоже убрал.py", line 2, in <module>
    t=turtle.Turtle()
  File "C:\Python34\lib\turtle.py", line 3816, in __init__
    visible=visible)
  File "C:\Python34\lib\turtle.py", line 2557, in __init__
    self._update()
  File "C:\Python34\lib\turtle.py", line 2660, in _update
    self._update_data()
  File "C:\Python34\lib\turtle.py", line 2646, in _update_data
    self.screen._incrementudc()
  File "C:\Python34\lib\turtle.py", line 1292, in _incrementudc
    raise Terminator
turtle.Terminator

Лично я понятия не имею что тут вообще происходит, судя по тексту ошибки возможно что ошибка в коде черепашки (turtle.py), но мне кажется косячу где-то я. Помогите пжалста))
Вот код программы:
import turtle, msvcrt, sys, time
t=turtle.Turtle()
from tkinter import *
helper=Tk()
c=Button(helper,
         text='Clear',
         bg='white', fg='black')
c.bind('<Button-1>', t.clear())
c.grid(row = 3, column = 1, columnspan = 3)
q=Button(helper,
         text='Exit',
         bg='grey', fg='red')
q.bind('<Button-1>', sys.exit)
q.grid(row = 2, column = 1)
up=Button(helper,
         text='Up',
         bg='light grey', fg='black')
up.bind('<Button-1>', t.up())
up.grid(row = 1, column = 3)
D=Button(helper,
         text='Down',
         bg='light grey', fg='black')
D.bind('<Button-1>', t.down())
D.grid(row = 2, column = 3)
helper.mainloop()
trn=5
run=5
while True:
  pressedKey = msvcrt.getch()
  if str(pressedKey) == "b'q'":
    sys.exit()
  elif str(pressedKey) == "b'w'":
    t.forward(run)
    time.sleep(0.01)
  elif str(pressedKey) == "b'a'":
    t.left(trn)
    time.sleep(0.01)
  elif str(pressedKey) == "b's'":
    t.backward(run)
    time.sleep(0.01)
  elif str(pressedKey) == "b'd'":
    t.right(trn)
    time.sleep(0.01)
  elif str(pressedKey) == "b'c'":
    t.clear()
  elif str(pressedKey) == "b't'":
    try:
      eval(input('''Enter code:
'''))
    except SyntaxError or ValueError or NameError or ZeroDivisionError or MemoryError or IndexError:
      print ('Error')
  elif str(pressedKey) == "b'u'":
    t.up()
  elif str(pressedKey) == "b'j'":
    t.down()
  elif str(pressedKey) == "b'W'":
    t.forward(run*2)
    time.sleep(0.01)
  elif str(pressedKey) == "b'A'":
    t.left(trn*2)
    time.sleep(0.01)
  elif str(pressedKey) == "b'S'":
    t.backward(run*2)
    time.sleep(0.01)
  elif str(pressedKey) == "b'D'":
    t.right(trn*2)
    time.sleep(0.01)
  • Вопрос задан
  • 428 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы