最近把空閒時間花在看《Rapid GUI programming with Python and Qt》一書上。 python
我選擇的是在python3 + PyQt4的平臺上。 shell
問題就出在QString上: api
>>>from PyQt4 import QtCore spa
>>> str = QString('Welcome') it
NameError: name 'QString' is not defined ast
換了一種方法: import
>>>from PyQt4.QtCore import QString
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
from PyQt4.QtCore import QString
ImportError: cannot import name QString module
又出現如此問題…… programming
求解救……
方法