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:\Users\dell\AppData\Local\Programs\Python\Python35\Lib>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:\Users\dell\AppData\Local\Programs\Python\Python35\Lib>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:\Users\dell\AppData\Local\Programs\Python\Python35\Lib>python pydoc.py -w math
wrote math.html
然后就可以在C:\Users\dell\AppData\Local\Programs\Python\Python35\Lib 下看到 math.html
C:\Users\dell\AppData\Local\Programs\Python\Python35\Lib\math.html
Python pydoc.py的更多相关文章
- python调用py中rar的路径问题。
1.python调用py,在py中的os.getcwd()获取的不是py的路径,可以通过os.path.split(os.path.realpath(__file__))[0]来获取py的路径. 2. ...
- python gettitle.py
#!/usr/bin/env python # coding=utf-8 import threading import requests import Queue import sys import ...
- django 1.7之后python manage.py syncdb没有了
在命令行输入python manage.py createsuperuser按照提示输入即可记得先初始化表. django>1.7 python manage.py makemigrations ...
- Python安装mysql-python错误提示python setup.py egg_info
做python项目,需要用到mysql,一般用python-mysql,安装时遇到错误提示如下: Command "python setup.py egg_info" failed ...
- python __init__.py用途
转自http://www.cnpythoner.com/post/2.html Python中的Module是比较重要的概念.常见的情况是,事先写好一个.py文 件,在另一个文件中需要import时, ...
- python setup.py uninstall
I have installed a python package with python setup.py install How do I uninstall it? ============== ...
- python 运行python manege.py runserver时报错:“no module named djangorestframework” 的解决方案
python 运行python manege.py runserver时报错:“no module named djangorestframework” 的解决方案 importerror:no mo ...
- Python Web.py
安装Web.py root@bt:~# sudo pip install web.py Downloading/unpacking web.py Downloading web.py-0.37.tar ...
- python __init__.py
python中的Module是比较重要的概念.常见的情况是,事先写好一个.py文 件,在另一个文件中需要import时,将事先写好的.py文件拷贝 到当前目录,或者是在sys.path中增加事先写好的 ...
随机推荐
- shell脚本仅列出当前目录下的文件及文件夹
#!/bin/bash function ergodic(){ ` # do # "/"$file ] # then # ergodic $"/"$file # ...
- 【转】NuGet.org 无法访问的解决方法
打开Nuget,发现又出问题了:未能解析此远程名称:’nuget.org’. 在浏览器中输入 http://nuget.org 会发现是无法打开的. 在cmd命令行里输入: nslookup nuge ...
- 让所有的浏览器都能识别HTML5标签样式的小插件
如今HTML5愈来愈引发大家的关注了,但目前支持HTML5的浏览器还不是主流,特别是国内用户近50%以上仍旧使用IE6,由于支持HTML5的IE9不支持Xp系统安装,这样未来很长一段时间,HTML5的 ...
- 深入理解Java:String
在讲解String之前,我们先了解一下Java的内存结构. 一.Java内存模型 按照官方的说法:Java 虚拟机具有一个堆,堆是运行时数据区域,所有类实例和数组的内存均从此处分配. JVM主要管理两 ...
- C/C++中的声明与定义
含义 声明(Declaration), 用于告诉编译器被声明的函数/变量的存在, 及它们的类型/调用格式信息, 以检查是否被正确调用. 声明不分配内存空间. 定义(Definition), 用于告诉编 ...
- Log4net中换行符
在log4net节点中 <appender name="DebugLogFileAppender" type="log4net.Appender.FileAppen ...
- WebService学习总结(四)——调用第三方提供的webService服务
http://www.cnblogs.com/xdp-gacl/p/4260627.html 互联网上面有很多的免费webService服务,我们可以调用这些免费的WebService服务,将一些其他 ...
- bootstrap做了一个表格
花了一下午做了一个表格: 大致是这样: 代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf ...
- Nancy总结(三)Nancy资料介绍
Nancy 是一个轻量级用于构建基于 HTTP 的 Web 服务,可以基于 .NET 和 Mono 平台构建轻量级基于 HTTP 的Web 服务.它更多的是借鉴了Ruby的一些特性和Ruby的MVC ...
- centos 下测试网速
wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py chmod a+rx speedtest. ...