Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的代码:
itemnum = QInputDialog.getText(self, "Recall - Item", "Item No.", QLineEdit.Normal, "") print itemnum
它返回(PyQt4.QtCore.QString(u'aa'), True)。我怎样才能得到文字"aa"?是操纵字符串的唯一解决方案吗?
(PyQt4.QtCore.QString(u'aa'), True)
"aa"
>>> from PyQt4.QtCore import QString >>> s = QString('Test') >>> s PyQt4.QtCore.QString(u'Test') >>> str(s) 'Test'