Skip to main content

tkthread - Enable threads to interact with tkinter

Tk (in Python, tkinter) is not thread-safe. It's not possible to interact with a tkinter UI from a thread other than the one in which it is running its event loop.

There are a number of workarounds, but they generally boil down to doing some sort of polling, which either introduces delays, or is wasteful of CPU resource.

This package provides a 'bridge' between threads and tkinter that does not suffer from either of these problems; threads can run freely, and can schedule operations to be performed on a tkinter UI. Those operations will be picked up with minimal delay and executed asynchronously with the threads, but without incurring any polling cost.

The examples provided demonstrate the difference in CPU cost between a 'polling' solution and the one provided by this package.

Metadata

Release files for rjgtoys-tkthread 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rjgtoys-tkthread 0.0.1
File Interpreter ABI Platform
rjgtoys_tkthread-0.0.1-py3-none-any.whl Python 3 none any Details

Release files / rjgtoys_tkthread-0.0.1-py3-none-any.whl

Download URL rjgtoys_tkthread-0.0.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4f87cc8a91c8868dde550fb65d8d09e13fa831fe159ba35f3d61a6b1c929f01
BLAKE2b-256 checksum
How to use checksums
e9bcf90c68afab0a6652cce45d880a4ef6bd621bfe5e6709d1cad58f359d16aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page