I have a python program and I am using pyqt
. I use QFileDialog
to select directory and then run a script with that directory. The problem is that if the directory name is in Greek the program stops with exception
ascii codec can't encode characters in position
If the name of the directory is in English everything works fine. How can i solve that?
try:
directory = QtGui.QFileDialog.getExistingDirectory(MainWindow,"Please select directory ") #Select the directory for check
if directory != "":
directory = str(directory)
self.updatedirectory(directory)
except Exception as e:
self.AlertMessage(e)