How to search help using python console

前端 未结 10 1560
长发绾君心
长发绾君心 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:58

    The pydoc -k flag searches the documentation.

    pydoc -k 
        Search for a keyword in the synopsis lines of all available modules.
    

    From a terminal, run..

    $ pydoc -k pdf
    

    ..for example:

    $ pydoc -k pdf
    PdfImagePlugin 
    wx.lib.pdfwin 
    PIL.PdfImagePlugin
    

    It doesn't search the contents of the documentation, but it searches all module names - if that's not enough, I'd suggest using Google or StackOverflow to search for "Python PDF module" or similar

提交回复
热议问题