interpreter.py 文件源码

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

项目:AsciiDots-Java 作者: LousyLynx 项目源码 文件源码
def on_output(self, value):
        self.output_count += 1

        if self.head != -1 and self.output_count > self.head:
            self.on_finish()
            return

        if self.silent:
            return

        if not self.debug or self.compat_debug:
            print(value, end='', flush=True)
        else:
            self.logging_pad.addstr(self.logging_loc, self.logging_x, str(value))
            self.logging_pad.refresh(self.logging_loc - min(self.logging_loc, curses.LINES -
                                     self.debug_lines - 1), 0, self.debug_lines, 0,
                                     curses.LINES - 1, curses.COLS - 1)

            # FIXME: This should count the number of newlines instead
            if str(value).endswith('\n'):
                self.logging_loc += 1
                self.logging_x = 1
            else:
                self.logging_x += len(value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号