ich habe erst vor einigen tagen mit Python angefangen und bin jetzt auf etwas gestossen, wo ich leider nicht weiter weiss.
Ich habe eine simple GUI mit PyQT4 erstellt. Beim click auf einen Button ("Quellverzeichnis") wird bei mir diese Methode aufgerufen.
Code: Alles auswählen
def onSource(self):
self.directorySource = QtGui.QFileDialog.getExistingDirectory(self,
self.tr("Verzeichnis mit allen TFWs (Quelle)"),
"C:\\Python25\\myScripts\\CopyTFW\\quelle",
QtGui.QFileDialog.DontResolveSymlinks | QtGui.QFileDialog.ShowDirsOnly)
if not self.directorySource.isEmpty():
print os.path.isdir(self.directorySource)
print os.path.normcase(self.directorySource)
und dan erhalte ich das als Ausgabe in der Konsole:
Code: Alles auswählen
True
Traceback (most recent call last):
File "C:\Python25\myScripts\CopyTFW\CopyTFW.exe.py", line 24, in onSource
print os.path.normcase(self.directorySource)
File "C:\Python25\Lib\ntpath.py", line 42, in normcase
return s.replace("/", "\\").lower()
AttributeError: lower