console.py 文件源码

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

项目:python-yakumo 作者: yosshy 项目源码 文件源码
def help(self):
        line = readline.get_line_buffer().rstrip()
        if line == '' or line[-1] != '(':
            return
        m = self.METHOD_PATTERN.search(line)
        if not m:
            return
        try:
            thisobject = eval(m.group(1), self.namespace)
        except Exception:
            return

        if not inspect.ismethod(thisobject):
            return
        m = self.METHOD_DEF_PATTERN.match(inspect.getsource(thisobject))
        if m:
            print("")
            print(m.group(1))
            print(inspect.getdoc(thisobject).strip())
            print(sys.ps1 + readline.get_line_buffer(), end='', flush=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号