Unsolved Python backend send data to GUI
-
Hi
I would want to build application, which:- Starts GUI application to frontend
- Starts Python script to background
- Receives message data from Python scripts (maybe every seconds)
- Show the messages in GUI on some table
Does anyone good examples how to do that?
Maybe it should have been to use QProcess ja QTimer ?
BR Esa
-
@EsaH said in Python backend send data to GUI:
Starts GUI application to frontend
What do you expect to write that GUI with: C++, QML, Python?
Starts Python script to background
If C++/QML from previous answer, how do you plan to run such scripts? using embedded interpreter? or just with external QProcess?
-
Hi and welcome to devnet,
What would that other script do ?
How does it generate data ?
How will you grab said data for your GUI ? -
@Pablo-J-Rogina said in Python backend send data to GUI:
@EsaH said in Python backend send data to GUI:
Starts GUI application to frontend
What do you expect to write that GUI with: C++, QML, Python?
GUI is written by QML through C++.
Starts Python script to background
If C++/QML from previous answer, how do you plan to run such scripts? using embedded interpreter? or just with external QProcess?
External QProcess would be better in that case for Python code.
-
@SGaist said in Python backend send data to GUI:
Hi and welcome to devnet,
What would that other script do ?
Actually it receives messages from a message broker (and also send messages to the broker).
How does it generate data ?
I think the script could use stdin and stdout channels to communicate with Qt application.
How will you grab said data for your GUI ?
Data comes from C++ backend to QML frontend.
One solution could be to use sockets to connect Qt and external application, but i think QProcess would be easier in that case.
-
What message broker are you using ?
-
@SGaist said in Python backend send data to GUI:
What message broker are you using ?
RabbitMQ and AMQP 0.9.1 protocol.
I know there are also exist https://github.com/ssproessig/qamqp/tree/develop but i am not sure how difficut it is use. I already have existing Python consumer and provider scripts for AMQP.
-
Since you are already using Python, did you consider using PySide2 or PyQt5 for your GUI application ? They can also use QML and you could directly leverage your existing Python code.