How to search help using python console

前端 未结 10 1299
长发绾君心
长发绾君心 2021-02-08 20:25

Is there any way to search for a particular package/function using keywords in the Python console?

For example, I may want to search \"pdf\" for pdf related tasks.

10条回答
  •  甜味超标
    2021-02-08 20:47

    Thinking recursively:

    >>> help(help)
    
    Help on _Helper in module site object:
    
    class _Helper(builtins.object)
     |  Define the builtin 'help'.
     |  This is a wrapper around **pydoc.help** (with a twist).
     |  
    
    ...
    

    from here:

    >>> import pydoc
    >>> help(pydoc)
    Help on module pydoc: ....
    

    lots of essential info on search in python docs there.

提交回复
热议问题