ocad.py 文件源码

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

项目:pysport 作者: sportorg 项目源码 文件源码
def parse(self, file):
        if not isinstance(file, str) and not isinstance(file, IO):
            raise TypeError("file is not str or IO")
        if isinstance(file, str):
            try:
                enc = 'windows-1251'
                with open(file, encoding=enc) as f:
                    content = f.readlines()
            except FileNotFoundError:
                raise FileNotFoundError("Not found " + file)
        else:
            content = file.readlines()
        self._data = [x.strip() for x in content]
        self.clear()

        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号