python doc in command line

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peng Yu

    python doc in command line

    Hi,

    Perl has a command line help perldoc. I'm wondering if python has a
    similar help command.

    Thanks,
    Peng
  • Fredrik Lundh

    #2
    Re: python doc in command line

    Peng Yu wrote:
    Perl has a command line help perldoc. I'm wondering if python has a
    similar help command.
    it's built into the interpreter, and Python tells you how to use it when
    you start Python in interactive mode.

    $ python
    Python 2.5.1
    Type "help", "copyright" , "credits" or "license" for more information.
    >>help
    Type help() for interactive help, or help(object) for help about object.
    >>help()
    Welcome to Python 2.5! This is the online help utility.

    If this is your first time using Python, you should definitely check out
    the tutorial on the Internet at http://www.python.org/doc/tut/.

    Enter the name of any module, keyword, or topic to get help on writing
    Python programs and using Python modules. To quit this help utility and
    return to the interpreter, just type "quit".

    To get a list of available modules, keywords, or topics, type "modules",
    "keywords", or "topics". Each module also comes with a one-line summary
    of what it does; to list the modules whose summaries contain a given
    word such as "spam", type "modules spam".

    helpquit

    You are now leaving help and returning to the Python interpreter.
    If you want to ask for help on a particular object directly from the
    interpreter, you can type "help(objec t)". Executing "help('string') "
    has the same effect as typing a particular string at the helpprompt.
    >>help("string" )
    Help on module string:

    NAME
    string - A collection of string operations (most are no
    longer used).

    FILE
    string.py

    ....
    >>help(len)
    Help on built-in function len in module __builtin__:

    len(...)
    len(object) -integer

    Return the number of items of a sequence or mapping.
    >>>
    (etc)

    </F>

    Comment

    • Ben Finney

      #3
      Re: python doc in command line

      Peng Yu <PengYu.UT@gmai l.comwrites:
      Perl has a command line help perldoc. I'm wondering if python has a
      similar help command.
      The interactive interpreter has a "help" command, and a corresponding
      "help" function which can be passed an object to display its
      docstrings recursively and nicely-formatted.

      The same facility is available with the external 'pydoc' command.

      --
      \ “The right to search for truth implies also a duty; one must |
      `\ not conceal any part of what one has recognized to be true.” |
      _o__) —Albert Einstein |
      Ben Finney

      Comment

      Working...