(Python 2.6)
Code: Alles auswählen
import Tkinter as tk
import turtle as tu
####
class Gui(object):
def __init__(self):
self.root = tk.Tk()
self.canvas = tk.Canvas(self.root, width=600, height=400)
self.turtle = tu.RawPen(self.canvas)
#self.turtle.speed(None)
self.canvas.pack()
self.turtle.ondrag(self.turtle.goto)
def run(self):
self.root.mainloop()
####
if __name__ == '__main__':
Gui().run()
erscheint.Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.ValueError'> ignored
Traceback (most recent call last):
File "<stdin>", line 27, in <module>
File "<stdin>", line 21, in run
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1020, in mainloop
self.tk.mainloop(n)
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1417, in __call__
self.widget._report_exception()
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1179, in _report_exception
root.report_callback_exception(exc, val, tb)
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1717, in report_callback_exception
import traceback, sys
File "/usr/lib/python2.6/traceback.py", line 3, in <module>
import linecache
RuntimeError: maximum recursion depth exceeded while calling a Python object
Bug oder Feature?
Bei der grossen Anzahl der 'ondrag'-Ereignisse werden die Koordinaten wohl gecacht, aber wieso passiert da irgendwo irgendetwas Rekursives? Im Turtle-Modul konnte ich keinen Hinweis darauf finden.

yipyip