zoukankan      html  css  js  c++  java
  • Python pydoc.py

    1. 查看帮助,我们可以在python命令行交互环境下用 help函数,比如:

      查看 math 模块:

    >>> help('math')
    Help on built-in module math:

    NAME
    math

    DESCRIPTION
    This module is always available. It provides access to the
    mathematical functions defined by the C standard.

    FUNCTIONS
    acos(...)
    acos(x)

    Return the arc cosine (measured in radians) of x.

    acosh(...)
    acosh(x)

    Return the inverse hyperbolic cosine of x.

    asin(...)
    asin(x)

    Return the arc sine (measured in radians) of x.

    asinh(...)
    asinh(x)

    Return the inverse hyperbolic sine of x.

    atan(...)
    atan(x)

    Return the arc tangent (measured in radians) of x.

    atan2(...)
    atan2(y, x)

    Return the arc tangent (measured in radians) of y/x.
    Unlike atan(y/x), the signs of both x and y are considered.

    atanh(...)
    atanh(x)

    Return the inverse hyperbolic tangent of x.

    ceil(...)
    ceil(x)

    Return the ceiling of x as an Integral.
    This is the smallest integer >= x.

    -- More --

    2. 或者用pydoc.py查看,比如:

    C:UsersdellAppDataLocalProgramsPythonPython35Lib>python pydoc.py math
    Help on built-in module math:

    NAME
    math

    DESCRIPTION
    This module is always available. It provides access to the
    mathematical functions defined by the C standard.

    FUNCTIONS
    acos(...)
    acos(x)

    Return the arc cosine (measured in radians) of x.

    acosh(...)
    acosh(x)

    Return the inverse hyperbolic cosine of x.

    asin(...)
    asin(x)

    Return the arc sine (measured in radians) of x.

    asinh(...)
    asinh(x)

    -- More --

    3. 或者可以利用pydoc.py生成html帮助文档:

       比如在端口8000:

    C:UsersdellAppDataLocalProgramsPythonPython35Lib>python pydoc.py -p 8000
    Server ready at http://localhost:8000/
    Server commands: [b]rowser, [q]uit

    然后就可以用浏览器打开 http://localhost:8000/ 看到帮助文档


    server> quit
    Server commands: [b]rowser, [q]uit
    server> uit
    Server commands: [b]rowser, [q]uit
    server> q
    Server stopped

    4. 也可以生成一个Html页面, 通过 -w 参数:

    C:UsersdellAppDataLocalProgramsPythonPython35Lib>python pydoc.py -w math
    wrote math.html

    然后就可以在C:UsersdellAppDataLocalProgramsPythonPython35Lib 下看到 math.html

    C:UsersdellAppDataLocalProgramsPythonPython35Libmath.html

  • 相关阅读:
    MISRA C:2012 8 Rules 8.1 A Standard C environment
    《程序设计与算法(二)算法基础》《第二周 递归》爬楼梯 4017
    关于extern "C"(详细剖析)
    Github与TortoiseGit关联
    《程序设计与算法(二)算法基础》《第二周 递归》四则运算表达式求值 4132
    c语言 宏
    MISRA C:2012 Dir-1.1(Required)
    《程序设计与算法(二)算法基础》《第二周 递归》逆波兰表达式
    cogs1619. [HEOI2012]采花 x
    cogs157. [USACO Nov07] 奶牛跨栏 x
  • 原文地址:https://www.cnblogs.com/alexyuyu/p/6240409.html
Copyright © 2011-2022 走看看