You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to get the path to an existing file, but the resulting path has a weird prefix, like it is moved in a temporary directory:
for a file located at /home/<user_name>/<folder_name>/<file_name.extension> I obtain the following path: /run/user/1000/doc/daf242de/<file_name.extension>
Here is the sample code (tested on Ubuntu)
if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication, QFileDialog
app = QApplication([])
dialog = QFileDialog()
dialog.setFileMode(QFileDialog.ExistingFile) # Accept a single file that exists
if dialog.exec():
file_path = dialog.selectedFiles[0]
print(file_path)
Do you know if it is normal, and how I could I configure the dialog such that I could retrieve the true path of the file I'm searching for?
Kind regards
The text was updated successfully, but these errors were encountered:
Hi,
I try to get the path to an existing file, but the resulting path has a weird prefix, like it is moved in a temporary directory:
for a file located at
/home/<user_name>/<folder_name>/<file_name.extension>
I obtain the following path:/run/user/1000/doc/daf242de/<file_name.extension>
Here is the sample code (tested on Ubuntu)
Do you know if it is normal, and how I could I configure the dialog such that I could retrieve the true path of the file I'm searching for?
Kind regards
The text was updated successfully, but these errors were encountered: