DawnlightSearch_main.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:DawnlightSearch 作者: chg-hou 项目源码 文件源码
def _open_file_or_folder(self, path):
        import os, subprocess
        if not os.path.exists(path):
            logger.warning("File/path does not exist: " + path)
            msg = translate('statusbar', "File/path does not exist: ") + path
            self.show_statusbar_warning_msg_slot(msg)
            return
        try:
            QDesktopServices.openUrl(QUrl.fromLocalFile(path))
            # if sys.platform.startswith('darwin'):
            #     subprocess.call(('open', path))
            # elif os.name == 'nt':
            #     os.startfile(path)
            # elif os.name == 'posix':
            #     subprocess.call(('xdg-open', path))
        except:
            self.show_statusbar_warning_msg_slot((translate('statusbar',"Cannot open file: %s")) % path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号