PyKDE.kdecore.KStandardDirs
准确地说,我正在尝试使用 PyKDE 。根据文档和根据 PyQt4 文档,此方法使用两个字符串调用,我可以使用标准 Pythonstr
代替QString
. 这不起作用:
>> KStandardDirs.locate()("socket", "foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: KStandardDirs.locate(): not enough arguments
>>> KStandardDirs.locate("socket", "foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: KStandardDirs.locate(): argument 1 has unexpected type 'str'
我不能使用QString
,因为它似乎不存在:
>>> from PyQt4.QtCore import QString
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name QString
>>> from PyQt4.QtCore import *
>>> QString
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'QString' is not defined
我究竟做错了什么?