[PyQt] stdin processing

Andreas Pakulat apaku at gmx.de
Tue Nov 6 18:08:41 GMT 2007

On 06.11.07 15:08:49, Vladimir Pouzanov wrote:
> Is there any way to read stdin line by line without blocking? My application
> receives data over stdin (one command per line) and should react immediately.
> I've tried to make such thing:
>     self.stdin = QtCore.QFile(self)
>     self.stdin.open(0, QtCore.QIODevice.ReadOnly)
>     self.connect(self.stdin, Qt.SIGNAL('readyRead()'), self.on_stdinReadyRead)
> buy readyRead never fires.
And what exactly is "self"? You should try to come up with a small
self-contained example.


Your reasoning is excellent -- it's only your basic assumptions that are wrong.

More information about the PyQt mailing list