[issue35211] Turtle Shutdown Problem(s)

bob moth report at bugs.python.org
Sun Nov 11 23:18:30 EST 2018


bob moth <bmoth at icloud.com> added the comment:

Apparently the draw() function must call itself via ontimer.

That is not in the docs. But 56 variations later...I just copied
Grant Jenks. Apparently he knows what's what.

And done() must be the last line.

If first omitted, only one draw loop executed, but it quits itself.
With done(), it loops via ontimer().

<pre><code>
def draw():
    myDrawCells()
    update()
    myComputeOneStep()
    ontimer(draw, LOOP_TIMER)
setup(BOARD_SIDE, BOARD_SIDE, None, None)
hideturtle()
tracer(False)
clear()
myInitialize()
draw()
done()
</code></pre>

So now alt-Q works in life2DEBUG.py. attached.

----------
Added file: https://bugs.python.org/file47926/life2DEBUG.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35211>
_______________________________________


More information about the Python-bugs-list mailing list