Actions in one thread changing data in another

Heads up! You've already completed this tutorial.

johny92010111384 | 2021-05-31 08:25:49 UTC | #1

Hello! I have a problem with my GUI aplication. I'll try to simply explain what i mean, maybe someby can hep me:). I have one main window. Using buttons I can open another windows . when main window is starting it also started another threads e.g. handling data from GPIO. And my problem is: when i press the button in window opened after clicked in main window i can't change anything in other threads. To test it I done everything the same but button was pressed in main window and then everything worked properly. I'm using ThreadPool. Different between main window and additional window is that in main window I'm creating threads wchich started together with main. I also tried to start the specific thread from the additional window and then also everything works but everthing what I'm doing in this thread waiting until I open the additional window. If i didn't open the thread never started but I need the data from this thread all the time when main is runnig. Maybe i wrote this in strange way but hope that somebody understand me. Thanks in advance Pawel


PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.

Book Now 60 mins ($195)

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Actions in one thread changing data in another was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular https://www.martinfitzpatrick.com/browse/books/ on the subject.