[PyKDE] Direction of output

ml at www.prostatepointers.org ml at www.prostatepointers.org
Wed Feb 18 04:46:01 GMT 2004


>> Suppose you have a simple pyqt window with two buttons: button 1 prints
>> the message "message 1" to stdout.  button 2 prints the message
>> "message 2" to stdout.
>>
>> Ok, open two apps, say xedit and konqueror and direct konqueror to a
>> form.
>> In a third window, start your pyqt app.  How do you cause the action
>> of button 1 to be directed to xedit and button 2 to be directed to the
>> konqueror form?
>>
>> If not stdout, how do you accomplish this?

> You could write the messages from button 2 to stderr or to a named pipe
> (fifo).
>
> regards
> Roland

Thanks for the reply, Roland.  In my (above) example, I really don't know
which apps will be running, so I can't pipe the output to the app unless
there is a way to grab the name of the app when I focus its window. (I
don't know how to do this.)  Further, stdout goes to the window where the
python app starts, not the application window that I focus prior to
clicking on button 1 or 2.

When I focus an app window, is there a simple way to grab the app name?
If so, as you suggested, perhaps a pipe would work.

Thanks,

gary




More information about the PyQt mailing list