[docs] [issue31421] IDLE doc: add section on developing tkinter apps.

Terry J. Reedy report at bugs.python.org
Mon Sep 11 13:03:23 EDT 2017

New submission from Terry J. Reedy:

One of IDLE's great features is being able to interactively work with tkinter gui's because run calls update, without blocking, in the background. Document it in a new subsection, '3.5 Developing tkinter applications'.

Adapt the following (written for a python-list response):

Mainloop is a blocking call, and while it is running, one can only interact with the data and gui in ways that one has already programmed.  If you run the above with python -i, or equivalently, from an IDLE editor, you will not see a >>> prompt until you close the tk windows, at which point there is nothing left to interact with.

However, if you run the code above from an IDLE editor, you can omit or comment out the mainloop call and still see the board, because IDLE's run code calls tk's update in a non-blocking manner about 20 times a second.  Without mainloop running, you immediately get a >>> prompt and can interact with the gui in a live exploratory fashion.  You can enter statements like the color assignment above, and the background updates will make them quickly take effect.

assignee: docs at python
components: Documentation, IDLE
messages: 301888
nosy: docs at python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE doc: add section on developing tkinter apps.
type: enhancement
versions: Python 3.6, Python 3.7

Python tracker <report at bugs.python.org>

More information about the docs mailing list