run_gui.py 文件源码

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

项目:ClassifyHub 作者: Top-Ranger 项目源码 文件源码
def get_file_content(self):
        filename = QFileDialog.getOpenFileName(None, 'Open file')[0]
        if filename is '':
            return ''
        try:
            with open(filename, 'r') as file:
                try:
                    return str(file.read())
                except Exception as e:
                    QMessageBox.warning(None, 'Can not open file', 'Can not open file {}:\n{}'.format(filename, e))
                    return ''
        except IOError:
            return ''

    ##
    # \brief Returns the remaining rate limit
    #
    # Returns -1 if an error occurred. This request do not xount against the rate limit.
    #
    # \return Rate limit or -1 if error occurred
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号