PDA

View Full Version : interprocess communication question



samirg
19th August 2007, 04:11
Dear folks,

I invoke python gui (PyQt) application (child) process from another (parent) process. After invocation, qt some time, parent process sends some information to this gui application (child process) by writing this information to stdin port of child process.

On gui application side, it needs to read 'its' stdin port and react to it.

What is the best way for qui application to read its stdin port, and where/when, in gui code, should it do so?

Any pointer to doc or an example will be very helpfull.

best regards,

wysota
19th August 2007, 09:07
There is no "best way"... You can use a QFile object that is assigned to STDIN to do that (it'll tell you whether there is actually anything to read). Where? Hmm... in some slot, probably, but it really depends what the application does and how it is constructed.

croftj
19th August 2007, 18:29
Hi,

Assuming python provides you full access to the qt classes and you use the QProcess class (http://doc.trolltech.com/4.3/qprocess.html). This class provides interfaces for communicating back and forth to the child process . It takes a bit of play to get familiar with it but it does work.

-joe

wysota
19th August 2007, 20:41
I think the thread author asks for the other side - how to read stdin "the Qt way" from within the child.

samirg
30th August 2007, 06:15
Thanks for all information on this question. I ended up using QSocketNotifier on stdin port
of the child process. In my case, parent process is a LISP-based vendor platform which
invokes child process written using PyQt.

thanks,:)