This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE doc: add section on developing tkinter apps.
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cryvate, docs@python, terry.reedy
Priority: normal Keywords: patch

Created on 2017-09-11 17:03 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3513 merged terry.reedy, 2017-09-12 12:40
PR 3514 merged python-dev, 2017-09-12 13:05
Messages (3)
msg301888 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 17:03
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.
msg301956 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-12 13:05
New changeset 98758bc67fb39b74bab368bef8ff3b34554c77c8 by Terry Jan Reedy in branch 'master':
bpo-31421: Document how IDLE runs tkinter programs. (#3513)
https://github.com/python/cpython/commit/98758bc67fb39b74bab368bef8ff3b34554c77c8
msg301960 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-12 13:45
New changeset 4d7807ab9ad9f990e948d250bbb390b23a790764 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31421: Document how IDLE runs tkinter programs. (GH-3513) (#3514)
https://github.com/python/cpython/commit/4d7807ab9ad9f990e948d250bbb390b23a790764
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75602
2017-09-12 13:45:52terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-09-12 13:45:02terry.reedysetmessages: + msg301960
2017-09-12 13:05:25python-devsetpull_requests: + pull_request3509
2017-09-12 13:05:20terry.reedysetmessages: + msg301956
2017-09-12 12:40:52terry.reedysetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request3508
2017-09-11 17:13:36cryvatesetnosy: + cryvate
2017-09-11 17:04:09terry.reedysetassignee: docs@python -> terry.reedy
2017-09-11 17:03:42terry.reedysetcomponents: - Documentation
2017-09-11 17:03:23terry.reedycreate