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@python
components: Documentation, IDLE
messages: 301888
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue31421>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to