Unsolved how to communicate between two app: one is Qt app; the other is a Python console app.
-
how to communicate between two app: one is Qt app; the other is a Python console app.
eg. the Qt app can tell the Python app to do something.
of course, the Python app can send back msg is better...but not necessary -
It's called IPC or interprocess communication, and it is a field of study unto itself. Several mechanisms exist: pipes/fifos, message queues, shared memory, simple semaphores or signals.
-
-
I recently made a Qt App that could be called by LabVIEW to do certain operations. To do the IPC I decided to use TCP/IP and in my Qt app made a QTcpServer and used sockets.
Basically my Qt app listens on a TCP/IP port and when anything capable of TCP/IP connects a new socket is created and the communication is bidirectional. To go a step farther I also wanted to play with Qt's JSON classes so I have the messages sent formatted with JSON so that it is easy to break apart the data and get to what is needed to make stuff happen.
To get started check out voidrealms on YouTube he has some good videos where he sets up a solid QTcpServer application. It may be overkill for your app but will certainly help get you out of the dark.
-
Hi,
Depending on the type of messaging you want to do, ZeroMQ might also be of interest.
-
any one familiar with Python CGI?
-
someone told me by using CGI, i can start the C++ app & Python app, and at runtime, the C++ app can send Message to Python app...
-
@opengpu CGI is an antique technique to write web server scripts. It is not meant to be used as IPC...
-
thank you. so that guy is wrong....