Here is an example script: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ from PyQt4.QtCore import * from PyQt4.QtGui import *
d = QDesktopServices() x = '/home/piotr/test2/lol bar/photo_4900_8ea80c_huge.jpg' print QUrl(x).isValid() d.openUrl(QUrl(x)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The problem is it won't work if there is a space in the path - "lol bar", for spaceless paths it works (also for example on windows it needs paths with slashes not backslashes...). How can I make the path valid for QDesktopServices? (the QUrl itself is valid) Running the script will result in error: file:///home/piotr/test2/lol%2520bar/photo_4900_8ea80c_huge.jpg does not exist. _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
