[PyQt] Missing method for QByteArray and Python3?

detlev detlev at die-offenbachs.de
Sat Jan 9 17:33:32 GMT 2010


really often I have this kind of code in my application when it comes to 
converting a QByteArray to s string under Python 3.1.

s = bytes(QByteArray).decode()

In Python 2 one could use 

s = unicode(QByteArray)

to get the same result. Did I miss something or could QByteArray get a 
decode() method to make it similar to a Python3 bytes or bytearray type?

Detlev Offenbach
detlev at die-offenbachs.de

More information about the PyQt mailing list