hi,
a Question if I may:
(There seems to be no dedicated topic for questions and answers about using (not developing) GTK)
Using Python, how do we do threading?
Q-a:
Is this right?
asyncio and threading serve two different purposes… ?
(I think I’m interested in threading, cause I want to display search results, searching through local files, continuously, as it’s happening, in a textview, adding lines, periodically.)
The distinction between I/O-bound and CPU-bound work is the single most important concept for deciding when to use asyncio. If your program spends time waiting — for the network, for the database, for a file system operation — asyncio can help. If it spends time computing — parsing, number crunching, data transformations — asyncio will not help, and you need multiprocessing instead. Knowing which category your bottleneck falls into saves you from applying the wrong tool.
openpython dot org / articles/python-asyncio-async-await-guide
Q-b:
Threading exists in GTK4, right?
Q-c:
This example here is a good and valid one, right?
https://pygobject.gnome.org/guide/threading.html
Q-d:
Is this valid for GTK, too?
https://docs.python.org/3/library/threading.html
Q-e:
Are there any “extra” recommendations? ![]()
Thanks in advance!
(and sorry if this isn’t the right place to ask about using (not developing) GTK)
Peter *
______
* I am a programming enthusiast, not a developer.