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中增加事先写好的 ...
随机推荐
- [Word]中批量修改图片大小和缩放比例方法
最近小编遇到一个问题:需要将一篇厘米.打开.宏名起好了,单击"创建"进入.返回word,工具-宏-宏(或者直接按Alt+F8),再次进入宏的界面,选择刚才编辑好的宏,并单击&quo ...
- 20145233 2016-2017 1 linux题目总结
20145233 2016-2017 1 linux题目总结 第一周考试知识汇总 判断:实验楼环境中所有的默认系统用户名和密码均为 shiyanlou.(x ). 填空:Linux Bash中,Ctr ...
- sql server 使用nolock提升性能
博客园有许多关于nolock的文章,大部分都写得很好,例如:http://www.cnblogs.com/huangxincheng/p/4292320.html 这里仅结合个人项目,作为个人笔记记录 ...
- WPF自适应可关闭的TabControl 类似浏览器的标签页
效果如图: 虽然说是自适应可关闭的TabControl,但TabControl并不需要改动,不如叫自适应可关闭的TabItem. 大体思路:建一个用户控件,继承自TabItem,里面放个按钮,点击的时 ...
- 浅谈Struts2
学过SSH框架很长一段时间了,一直没有很系统的总结一下,这里先简单谈谈Struts2. 为什么要用Struts2? 这里列举一些Servlet的缺点: 1.每写一个servlet在web.xml中都要 ...
- ECMAScript 6 Features 中文版
ECMAScript 6 Features 中文版 如词不达意,欢迎提 PR & issue 采用中英混排的方式进行译制,如不解请查看对应原文 本文档将与原作者的 文档 保持同步更新,欢迎关注 ...
- npm+node+cordova+ionic 版本匹配
npm 2.15.8 node 4.4.7 cordova 6.1.0 ionic 1.7.16
- JavaScript实现计算两个日期之间的天数
以“yyyy-MM-dd”格式为例,现在有两个日期,分别为“2006-01-01”,“2007-05-20”. 1.调用Date.parser()方法,将字符串格式的时间戳转换为Date类型时间对象: ...
- 修改httpd默认端口号
Tomcat: vim /etc/httpd/conf/httpd.conf//别忘了service httpd restart Nginx: vim /etc/nginx/nginx.conf//完 ...
- 线段树 poj 1436
题目大意:给出n条垂直于x轴的线段的数据y1,y2,x,求出有几个三条线段一组的三元组并且他们兩兩能相见的.思路:对y轴建树,将x排序,然后按顺序边询问边擦入,用mark[i][j]表示j往左可以看到 ...