PyKDE.kdecore.KStandardDirs
正確には、PyKDE を使用しようとしています。ドキュメントによると、このメソッドは 2 つの文字列で呼び出され、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
私は何を間違っていますか?