1
這是我的代碼:QInputDialog不返回不僅僅是文字
itemnum = QInputDialog.getText(self, "Recall - Item", "Item No.", QLineEdit.Normal, "")
print itemnum
它返回(PyQt4.QtCore.QString(u'aa'), True)
。我如何得到文本"aa"
?是唯一的解決方案來操縱字符串?
這是我的代碼:QInputDialog不返回不僅僅是文字
itemnum = QInputDialog.getText(self, "Recall - Item", "Item No.", QLineEdit.Normal, "")
print itemnum
它返回(PyQt4.QtCore.QString(u'aa'), True)
。我如何得到文本"aa"
?是唯一的解決方案來操縱字符串?
>>> from PyQt4.QtCore import QString
>>> s = QString('Test')
>>> s
PyQt4.QtCore.QString(u'Test')
>>> str(s)
'Test'
'print str(itemnum [0])' – 2013-03-25 20:17:18
Thank you @ A.Rodas .. that do it .. – JoeMicro 2013-03-25 20:44:31