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中增加事先写好的 ...
随机推荐
- Java使用代理服务器
HTTP协议是基于TCP协议的,TCP协议在Java中的体现就是套接字.在了解HTTP协议的基础上,完全可以通过TCP来实现一套HTTP库,这个库可以发起网络请求和接受网络请求.只要能用URLConn ...
- Android 线程池(转)
new Thread的弊端及Java四种线程池的使用: 1.new Thread的弊端 ); } catch (InterruptedException e) { // TODO Auto-gener ...
- java基于socket的简单聊天系统
/*=============服务端================*/ /** * 服务器程序 在9999端口监听 * 可以通过控制台输入来回应客户端* @author xiaoluo* @qq 3 ...
- 现阶段Mono版本下的WebAPI开发中存在的一些问题
背景 由于公司积极推动各业务产品服务化,得益于容器化技术的不断发展及普及,项目组的服务也更多地基于Mono,Jexus,Docker,Kubernetes等类库.容器.管理工具运行于Linux系统上. ...
- 关于Deprecated: mysql_result: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
require_once('connect.php'); $sql = "select * from introduce"; \(query = mysql_query(\)sql ...
- css-css权威指南学习笔记4
第三章 1.继承的值没有特殊性,甚至连0的特殊性都没有.所以改变超链接的样式一般需要独立声明,无法通过继承改变. 2.层叠--冲突的声明通过这个层叠的过程排序,并由此确定最终的文档表示.这个过程的核心 ...
- C#把DataTable中数据一次插入数据库的方法
现在实际的情况是这样的: 客户有一台打卡机,员工打卡的信息全部储存在打卡机的Access数据库里面,现在客户引入了一种新的管理系统,需要将Access数据库中的打卡数据同步到SQL Server数据库 ...
- BZOJ 4569 萌萌哒
题目传送门 4569: [Scoi2016]萌萌哒 Time Limit: 10 Sec Memory Limit: 256 MB Submit: 483 Solved: 221 [Submit][S ...
- c#.Net:Excel导入/导出之NPOI 2.0简介
NPOI 2.0+主要由SS, HPSF, DDF, HSSF, XWPF, XSSF, OpenXml4Net, OpenXmlFormats组成,具体列表如下: 资料来自:百度百科 Ass ...
- C#环境