[PyKDE] PyQt: Something wrong with QTextStream.read()

Troy Melhase troy at gci.net
Sun Dec 19 00:14:28 GMT 2004


On Saturday 18 December 2004 02:55 pm, Parzival Herzog wrote:
> 1 from qt import *
> 2 woof = "WOOF\n"
> 3 print woof
> 4 woof_ts = QTextStream(woof, IO_ReadOnly)
> 5 print woof
> 6 rewoof = woof_ts.read()
> 7 print rewoof

Can you make the string a QByteArray?  This works for me:


from qt import *
woof = QByteArray("WOOF\n")
print woof
woof_ts = QTextStream(woof, IO_ReadOnly)
print woof
rewoof = woof_ts.read()
print rewoof


-- 
Troy Melhase, troy at gci.net
--
It is terrible to contemplete how few politicians are hanged. - G. K. 
Chesterton




More information about the PyQt mailing list