[PySide] Using QTextStream with stdin

John Tourtellott john.turtle at gmail.com
Sat Jul 21 05:02:27 CEST 2012


The QTextStream documentation states that it is common to use
PySide.QtCore.QTextStream to read console input, however, I get a python
error when I try the example in the documentation:

stream = QTextStream(sys.stdin.fileno())


I'll paste the full error message below, but basically QTextStream has no
constructor that takes in an integer (which the file descriptor is). How do
you use QTextStream to read console input?

Python error message:

TypeError: 'PySide.QtCore.QTextStream' called with wrong argument types:
  PySide.QtCore.QTextStream(int)
Supported signatures:
  PySide.QtCore.QTextStream()
  PySide.QtCore.QTextStream(PySide.QtCore.QByteArray,
PySide.QtCore.QIODevice.OpenMode = QIODevice.ReadWrite)
  PySide.QtCore.QTextStream(PySide.QtCore.QIODevice)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20120720/7d20aa02/attachment.html>


More information about the PySide mailing list