pythonrc.py 文件源码

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

项目:pythonrc 作者: lonetwin 项目源码 文件源码
def _exec_from_file(self, filename, quiet=False):
        previous = ''
        for stmt in open(filename):
            # - skip over multiple empty lines
            stripped = stmt.strip()
            if stripped == '' and stripped == previous:
                continue
            if not quiet:
                self.write(cyan("... {}".format(stmt)))
            if not stripped.startswith('#'):
                line = stmt.strip('\n')
                self.push(line)
                readline.add_history(line)
            previous = stripped
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号