reprint.py 文件源码

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

项目:reprint 作者: Yinzo 项目源码 文件源码
def __exit__(self, exc_type, exc_val, exc_tb):
        global is_atty

        self.refresh(forced=True)
        if is_atty:
            columns, _ = get_terminal_size()
            if self.force_single_line:
                print('\n' * len(self.warped_obj), end="")
            else:
                print('\n' * lines_of_content(self.warped_obj, columns), end="")
            global last_output_lines
            global overflow_flag
            last_output_lines = 0
            if overflow_flag:
                if not self.no_warning:
                    print("Detected that the lines of output has been exceeded the height of terminal windows, which \
                    caused the former output remained and keep adding new lines.")
                    print("????????, ??????????????, ???????????, ???????????????????")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号