readline.py 文件源码

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

项目:pyrepl 作者: dajose 项目源码 文件源码
def after_command(self, cmd):
        super(ReadlineAlikeReader, self).after_command(cmd)
        if self.more_lines is None:
            # Force single-line input if we are in raw_input() mode.
            # Although there is no direct way to add a \n in this mode,
            # multiline buffers can still show up using various
            # commands, e.g. navigating the history.
            try:
                index = self.buffer.index("\n")
            except ValueError:
                pass
            else:
                self.buffer = self.buffer[:index]
                if self.pos > len(self.buffer):
                    self.pos = len(self.buffer)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号