我正在尝试使用 QDesktopServices 让系统打开指定的文件或文件夹。
下面的代码非常适用于其中没有空格但否则无法执行的路径
def openFile(self):
print self.oVidPath
print "\n"
url = QUrl(self.oVidPath)
QDesktopServices.openUrl(url)
self.Dialog.close()
带空格的路径的输出是
/home/kerneldev/Documents/Why alcohol doesn't come with nutrition facts.mp4
gvfs-open: /home/kerneldev/Documents/Why%20alcohol%20doesn't%20come%20with%20nutrition%20facts.mp4: error opening location: Error when getting information for file '/home/kerneldev/Documents/Why%20alcohol%20doesn't%20come%20with%20nutrition%20facts.mp4': No such file or directory
我已验证指定的路径存在。
请帮忙