Python help command

后端 未结 2 888
梦谈多话
梦谈多话 2020-12-21 08:07

How can Python\'s help information on a given module/function be obtained?

For example, to obtain information on scipy\'s chi2, the following commands:



        
相关标签:
2条回答
  • 2020-12-21 08:35

    If you are on Python3 it is better to invoke the help prompt first.

    Python3> help ()

    Then while in help prompt, type the method you are looking for

    help> modulename.methodname ( if you know the modules and methods already ).

    If you do not - then while in help prompt,

    help> modules ( list all the modules ).

    To see what methods nltk has go out of help and type

    Python3> import nltk Python3> dir (nltk)

    0 讨论(0)
  • 2020-12-21 09:00

    The help() function only displays the docstring of the object you're calling it on. If that object doesn't have one (or one that doesn't contain the information you're after), you will need to look at the documentation of the module/function/object you're using.

    0 讨论(0)
提交回复
热议问题