I was researching for some time to find information how to do multithreaded program using PyQT, updating GUI to show the results.
I’m used to learning by example and i can’t find (yes i was looking for weeks) any simple example of program using multithreading doing such simple task as for example connecting to list of www sites (5 threads) and just printing processed urls with response code.
Could anyone share code or send me to good tutorial where such program is explained ?
Here some very basic examples.
You can pass references to GUI elements to threads, and update them in thread.
Editors Note: Qt widgets are not thread safe and should not be accessed from any thread but the main thread (see the Qt documentation for more details). The correct way to use threads is via signals/slots as the second part of this answer shows.
Also, you can use signals and slots, to separate gui and network logic.