Python PyQt5 跨平台 读取linux 路径的坑
电脑版发表于:2020/9/16 17:01
self.url = os.path.abspath('.').replace("\\","/") + r'/youer_file_path/filename.html'
这样写 linux 是读不到文件 按道理说 路径转成 / 是可以的 但是就是读取不到
解决方案:
self.url = "file://" + os.path.join(os.getcwd(), "you_file_path/filename.html")