vendredi 28 décembre 2018

I don't understand how a Python GUI app should be designed

I've created a new app with Python and PyQT5. The app/gui is used to call external binaries that do some work with files. I have all buttons working and when I hit run I create a thread that executes the binaries (with subprocess.run). My pain point and what I don't understand is how to send feedback from the thread to GUI. If I use .join() I block the GUI. Events seams to be the wrong solution (How to send a signal to the main thread in python without using join?)

Thanks

Summary

What I have: (GUI classes) -> thread--> python method that calls subpocess.run I used the thread thinking that I need to decouple the GUI thread from the business logic.

What I need to figure out: how to determine if thread is done without blocking the GUI.

Aucun commentaire:

Enregistrer un commentaire