【发布时间】:2019-12-30 22:58:02
【问题描述】:
我有一个名为roleName 的PySide2.QtCore.QByteArray 对象,我得到了一个python 字符串的编码:
propName = metaProp.name() // this is call of [const char *QMetaProperty::name() ](https://doc.qt.io/qt-5/qmetaproperty.html#name)
// encode the object
roleName = QByteArray(propName.encode())
print(roleName) // this gives b'myname'
// now I would like to get just "myname" without the "b"
roleString = str(roleName)
print(roleString) // this gives the same output as above
我怎样才能找回我解码的字符串?
【问题讨论】:
-
@ekhumoro 是的,可以解决问题。您想将您的评论转化为答案,以便我将此问题标记为已解决吗?
标签: python python-3.x string pyside2 qbytearray