当前位置: 首页>>代码示例>>Python>>正文


Python pydoc.help方法代码示例

本文整理汇总了Python中pydoc.help方法的典型用法代码示例。如果您正苦于以下问题:Python pydoc.help方法的具体用法?Python pydoc.help怎么用?Python pydoc.help使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pydoc的用法示例。


在下文中一共展示了pydoc.help方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __call__

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def __call__(self, topic=None):
        if topic is None:
            sys.stdout._write("<span class=help>%s</span>" % repr(self))
            return
        import pydoc

        pydoc.help(topic)
        rv = sys.stdout.reset()
        if isinstance(rv, bytes):
            rv = rv.decode("utf-8", "ignore")
        paragraphs = _paragraph_re.split(rv)
        if len(paragraphs) > 1:
            title = paragraphs[0]
            text = "\n\n".join(paragraphs[1:])
        else:  # pragma: no cover
            title = "Help"
            text = paragraphs[0]
        sys.stdout._write(HELP_HTML % {"title": title, "text": text}) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:20,代码来源:repr.py

示例2: dispatch_repr

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def dispatch_repr(self, obj, recursive):
        if obj is helper:
            return u'<span class="help">%r</span>' % helper
        if isinstance(obj, (integer_types, float, complex)):
            return u'<span class="number">%r</span>' % obj
        if isinstance(obj, string_types) or isinstance(obj, bytes):
            return self.string_repr(obj)
        if isinstance(obj, RegexType):
            return self.regex_repr(obj)
        if isinstance(obj, list):
            return self.list_repr(obj, recursive)
        if isinstance(obj, tuple):
            return self.tuple_repr(obj, recursive)
        if isinstance(obj, set):
            return self.set_repr(obj, recursive)
        if isinstance(obj, frozenset):
            return self.frozenset_repr(obj, recursive)
        if isinstance(obj, dict):
            return self.dict_repr(obj, recursive)
        if deque is not None and isinstance(obj, deque):
            return self.deque_repr(obj, recursive)
        return self.object_repr(obj) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:24,代码来源:repr.py

示例3: __call__

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def __call__(self, topic=None):
        if topic is None:
            sys.stdout._write('<span class=help>%s</span>' % repr(self))
            return
        import pydoc
        pydoc.help(topic)
        rv = sys.stdout.reset()
        if isinstance(rv, bytes):
            rv = rv.decode('utf-8', 'ignore')
        paragraphs = _paragraph_re.split(rv)
        if len(paragraphs) > 1:
            title = paragraphs[0]
            text = '\n\n'.join(paragraphs[1:])
        else:  # pragma: no cover
            title = 'Help'
            text = paragraphs[0]
        sys.stdout._write(HELP_HTML % {'title': title, 'text': text}) 
开发者ID:jpush,项目名称:jbox,代码行数:19,代码来源:repr.py

示例4: dispatch_repr

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def dispatch_repr(self, obj, recursive):
        if obj is helper:
            return u'<span class="help">%r</span>' % helper
        if isinstance(obj, (integer_types, float, complex)):
            return u'<span class="number">%r</span>' % obj
        if isinstance(obj, string_types):
            return self.string_repr(obj)
        if isinstance(obj, RegexType):
            return self.regex_repr(obj)
        if isinstance(obj, list):
            return self.list_repr(obj, recursive)
        if isinstance(obj, tuple):
            return self.tuple_repr(obj, recursive)
        if isinstance(obj, set):
            return self.set_repr(obj, recursive)
        if isinstance(obj, frozenset):
            return self.frozenset_repr(obj, recursive)
        if isinstance(obj, dict):
            return self.dict_repr(obj, recursive)
        if deque is not None and isinstance(obj, deque):
            return self.deque_repr(obj, recursive)
        return self.object_repr(obj) 
开发者ID:jpush,项目名称:jbox,代码行数:24,代码来源:repr.py

示例5: __repr__

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def __repr__(self):
        return "Type help(object) for help about object." 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:repr.py

示例6: __repr__

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def __repr__(self):
        return 'Type help(object) for help about object.' 
开发者ID:jpush,项目名称:jbox,代码行数:4,代码来源:repr.py

示例7: __repr__

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def __repr__(self):
        return "Type help() for interactive help, " \
               "or help(object) for help about object." 
开发者ID:glmcdona,项目名称:meddle,代码行数:5,代码来源:site.py

示例8: __call__

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def __call__(self, *args, **kwds):
        import pydoc
        return pydoc.help(*args, **kwds) 
开发者ID:glmcdona,项目名称:meddle,代码行数:5,代码来源:site.py

示例9: sethelper

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def sethelper():
    __builtin__.help = _Helper() 
开发者ID:glmcdona,项目名称:meddle,代码行数:4,代码来源:site.py

示例10: test_namedtuple_public_underscore

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def test_namedtuple_public_underscore(self):
        NT = namedtuple('NT', ['abc', 'def'], rename=True)
        with captured_stdout() as help_io:
            pydoc.help(NT)
        helptext = help_io.getvalue()
        self.assertIn('_1', helptext)
        self.assertIn('_replace', helptext)
        self.assertIn('_asdict', helptext) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:10,代码来源:test_pydoc.py

示例11: sethelper

# 需要导入模块: import pydoc [as 别名]
# 或者: from pydoc import help [as 别名]
def sethelper():
    builtins.help = _Helper() 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:4,代码来源:site.py


注:本文中的pydoc.help方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。