• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pydoc.help函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_resolve_false

 def test_resolve_false(self):
     # Issue #23008: pydoc enum.{,Int}Enum failed
     # because bool(enum.Enum) is False.
     with captured_stdout() as help_io:
         pydoc.help('enum.Enum')
     helptext = help_io.getvalue()
     self.assertIn('class Enum', helptext)
开发者ID:Martiusweb,项目名称:cpython,代码行数:7,代码来源:test_pydoc.py


示例2: help

def help(obj=None):
  if not obj:
    print """Welcome to Abrupt!

If this is your first time using Abrupt, you should check the
quickstart at http://securusglobal.github.com/abrupt/.

Here are the basic functions of Abrupt, type 'help(function)'
for a complete description of these functions:
  * proxy: Start a HTTP proxy on port 8080.
  * create: Create a HTTP request based on a URL.
  * inject: Inject or fuzz a request.

Abrupt have few classes which worth having a look at, typing 'help(class)':
  * Request
  * Response
  * RequestSet

There are also few interesting global objects, 'help(object)':
  * conf
  * history

Please, report any bug or comment to [email protected]"""
  else:
    pydoc.help(obj)
开发者ID:lukejahnke,项目名称:abrupt,代码行数:25,代码来源:console.py


示例3: test_dispatch_method_class_help

def test_dispatch_method_class_help(capsys):
    pydoc.help(Foo)
    out, err = capsys.readouterr()
    assert rstrip_lines(out) == """\
Help on class Foo in module reg.tests.fixtures.module:

class Foo({builtins}.object)
 |  Class for foo objects.
 |
 |  Methods defined here:
 |
 |  bar(self, obj)
 |      Return the bar of an object.
 |
 |  baz(self, obj)
 |      Return the baz of an object.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables (if defined)
 |
 |  __weakref__
 |      list of weak references to the object (if defined)
""".format(builtins=object.__module__)
开发者ID:morepath,项目名称:reg,代码行数:26,代码来源:test_docgen.py


示例4: help

def help(obj, visualization=False, ansi=True):
    """
    Extended version of the built-in help that supports parameterized
    functions and objects. If ansi is set to False, all ANSI color
    codes are stripped out.
    """
    ansi_escape = re.compile(r'\x1b[^m]*m')
    parameterized_object = isinstance(obj, param.Parameterized)
    parameterized_class = (isinstance(obj,type)
                           and  issubclass(obj,param.Parameterized))

    if parameterized_object or parameterized_class:
        if Store.registry.get(obj if parameterized_class else type(obj), False):
            if visualization is False:
                print("\nTo view the visualization options applicable to this object or class, use:\n\n"
                      "   holoviews.help(obj, visualization=True)\n")
            else:
                Store.info(obj, ansi=ansi)
                return
        info = param.ipython.ParamPager()(obj)
        if ansi is False:
            info = ansi_escape.sub('', info)
        print(info)
    else:
        pydoc.help(obj)
开发者ID:richwu,项目名称:holoviews,代码行数:25,代码来源:__init__.py


示例5: usage

def usage():
    if __name__ == '__main__':
        import pydoc
        #FIXME: literally displayed '__main__'
        print pydoc.help(__name__)
    else:
        help(str(os.path.basename(sys.argv[0]).split('.')[0]))
开发者ID:ArnoCan,项目名称:epyunit,代码行数:7,代码来源:setup.py


示例6: output_help_to_file

def output_help_to_file(filepath, request):
    f = file(filepath, 'w')
    sys.stdout = f
    pydoc.help(request)
    f.close()
    sys.stdout = sys.__stdout__
    return
开发者ID:dirk2011,项目名称:mymc_git,代码行数:7,代码来源:generate_helpdocs.py


示例7: test_namedtuple_public_underscore

 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:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:8,代码来源:test_pydoc.py


示例8: output_help_to_file

def output_help_to_file(request):
	filepath  = request + "_package_info.txt"
	f = file(filepath, 'w')
	sys.stdout = f
	pydoc.help(request)
	f.close()
	sys.stdout = sys.__stdout__
	return
开发者ID:merakee,项目名称:NLP_Code,代码行数:8,代码来源:get_package_info.py


示例9: _help

    def _help(*args):
        # because of how the console works. we need our own help() pager func.
        # replace the bold function because it adds crazy chars
        import pydoc
        pydoc.getpager = lambda: pydoc.plainpager
        pydoc.Helper.getline = lambda self, prompt: None
        pydoc.TextDoc.use_bold = lambda self, text: text

        pydoc.help(*args)
开发者ID:BlueLabelStudio,项目名称:blender,代码行数:9,代码来源:console_python.py


示例10: test_pydoc_gitr

def test_pydoc_gitr(capsys):
    """
    Verify the behavior of running 'pydoc gitr'
    """
    pytest.dbgfunc()
    pydoc.help(gitr)
    o, e = capsys.readouterr()
    z = docopt_exp()
    for k in z:
        assert k in o
开发者ID:tbarron,项目名称:gitr,代码行数:10,代码来源:test_gitr.py


示例11: help

    def help(self, *args, **kwargs):
        """Print Automate help if no parameter is given. Otherwise,
           act as pydoc.help()"""
        if len(args) > 0 or len(kwargs) > 0:
            import pydoc

            pydoc.help(*args, **kwargs)
        else:
            hstr = helpstr
            for i in hstr.split("\n"):
                self.logger.info(i)
        return True
开发者ID:tuomas2,项目名称:automate,代码行数:12,代码来源:textui.py


示例12: main

def main():
    f = Foo(4)
    assert(f.value2 == 8)
    f.value2 = 5     # This will override value2() method
    assert(f.value2 == 5)
    assert(f.value3 == 4)
    f.value3 = 6
    assert(f.value3 == 6)
    print help(Foo)
    del(f.value3)
    print "Success."
    return 0
开发者ID:von,项目名称:sandbox,代码行数:12,代码来源:property.py


示例13: main

def main():
    """
    Usage: 
         pyXPad [opt] output

    Argument:
        output: Base name for the output file. Image number and extension will
            be append.
            Ex:
                #python pyXPad data/Test
                #ls data/Test*
                data/Test_0000.edf

    Options:
        -c: Load calibration files. Calibration file names are defined in
            pyXPad_conf.py
        -n: Number of images to be taken.
        -e: Exposure time in us.
        -l: Latency time in us (minimum 5000 us).
        -o: Overflow counter pull period (minimum 4000 us).
        -t: Trigger mode.
            0: Internal trigger
            1: External gate
            2: External trigger for sequence
            3: External trigger for singles
        -a: Analog output mode.
            0: Bussy
            1: Bussy - Shutter time
            2: Image read enabled
            3: Overflow counter pull
            4: Exposure
            5: Reserved
            6: Image transfer
            7: FIFO full
            8: External Gate
            9: Reserved

    Press "q" to exit 

    """

    import getopt, sys
    import pydoc
    import time
    from EdfFile import EdfFile as EDF

    try:
        opts, args = getopt.getopt(sys.argv[1:], "cn:t:a:e:l:o:")
    except getopt.GetoptError, err:
        # print help information and exit:
        pydoc.help(main)
        sys.exit(2)
开发者ID:gjover,项目名称:Lima-camera-xpad,代码行数:52,代码来源:Communication.py


示例14: help

 def help(*objects):
     """Print doc strings for object(s).
     Usage:  >>> help(object, [obj2, objN])  (brackets mean [optional] argument)
     """
     if len(objects) == 0:
         help(help)
         return
     for obj in objects:
         try:
             print('****', obj.__name__ , '****')
             print(obj.__doc__)
         except AttributeError:
             print(obj, 'has no __doc__ attribute')
             print()
开发者ID:peplin,项目名称:python-startup,代码行数:14,代码来源:startup.py


示例15: get_help

 def get_help(self, topic):
     title = text = None
     if topic is not None:
         import pydoc
         pydoc.help(topic)
         rv = sys.stdout.reset().decode('utf-8', 'ignore')
         paragraphs = _paragraph_re.split(rv)
         if len(paragraphs) > 1:
             title = paragraphs[0]
             text = '\n\n'.join(paragraphs[1:])
         else:
             title = 'Help'
             text = paragraphs[0]
     return render_template('help_command.html', title=title, text=text)
开发者ID:danaspiegel,项目名称:softball_stat_manager,代码行数:14,代码来源:repr.py


示例16: __call__

 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 = text_(sys.stdout.reset(), '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:sseg,项目名称:aiohttp_debugtoolbar,代码行数:15,代码来源:repr.py


示例17: __call__

 def __call__(self, topic=None):
     title = text = None
     if topic is not None:
         import pydoc
         pydoc.help(topic)
         rv = sys.stdout.reset().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]
     rv = render_template('help_command.html', title=title, text=text)
     sys.stdout._write(rv)
开发者ID:EnTeQuAk,项目名称:werkzeug,代码行数:15,代码来源:repr.py


示例18: __call__

    def __call__(self, *args, **kwds):
        if args and args[0]==self.socialite:
            print self.socialiteHelp
            return

        import pydoc
        return pydoc.help(*args, **kwds)
开发者ID:Bloodevil,项目名称:socialite,代码行数:7,代码来源:console.py


示例19: init

def init():
	# for PythonExtensions Help File
	PythonHelp = 0		# doesn't work on systems which haven't installed Python
			
	# dump Civ python module directory
	if PythonHelp:		
		import CvPythonExtensions
		helpFile=file("CvPythonExtensions.hlp.txt", "w")
		sys.stdout=helpFile
		import pydoc                  
		pydoc.help(CvPythonExtensions)
		helpFile.close()
	
	sys.stderr=CvUtil.RedirectError()
	sys.excepthook = CvUtil.myExceptHook
	sys.stdout=CvUtil.RedirectDebug()
开发者ID:hardtimes1966,项目名称:modxml,代码行数:16,代码来源:CvAppInterface.py


示例20: __call__

 def __call__(self, *args, **kwds):
     if args and args[0]==self.socialite:
         print self.socialite.__doc__
         return
     elif args and args[0]==self.socialiteExamples:
         print self.socialite.examples
         return
     import pydoc
     return pydoc.help(*args, **kwds)
开发者ID:David-Bess,项目名称:medicare-demo,代码行数:9,代码来源:SociaLite.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pydoc.ispackage函数代码示例发布时间:2022-05-25
下一篇:
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap