pydoc是Python自带的模块,主要用于从python模块中自动生成文档,这些文档可以基于文本呈现的、也可以生成WEB 页面的,还可以在服务器上以浏览器的方式呈现!

windows powershell:

> python -m pydoc input
Help on built-in function input in module __builtin__: input(...)
input([prompt]) -> value Equivalent to eval(raw_input(prompt)).

linux:

$ pydoc input 

pydoc help:

> python -m pydoc input
Help on built-in function input in module __builtin__: input(...)
input([prompt]) -> value Equivalent to eval(raw_input(prompt)).

给定的端口启动HTTP

python -m pydoc -p 1234 #比如说: 端口为1234
pydoc server ready at http://localhost:1234/
pydoc server stopped

参数 -k 在所有可用的模块中按关键字搜索

> python -m pydoc -k os
_locale - Support for POSIX locales.
_osx_support - Shared OS X support functions.
binhex - Macintosh binhex compression/decompression.
codeop - Utilities to compile possibly incomplete Python source code.
commands - Execute shell commands via os.popen() and return status, output.
custom_tools.post_install
encodings.palmos - Python Character Mapping Codec for PalmOS 3.5.
genericpath - Path operations common to more than one OS
hotshot - High-perfomance logging profiler, mostly written in C.
idlelib.macosxSupport - A number of functions that enhance IDLE on Mac OSX.
lib2to3.fixer_util - Utility functions, node construction macros, etc.
lib2to3.fixes.fix_getcwdu - Fixer that changes os.getcwdu() to os.getcwd().

参数 -g将启动图形界面

> python -m pydoc -g

参数 -w将指定模块的文本字符串生成HTML格式

> python -m pydoc -w input
wrote input.html

python pydoc的更多相关文章

  1. Python pydoc.py

    1. 查看帮助,我们可以在python命令行交互环境下用 help函数,比如: 查看 math 模块: >>> help('math')Help on built-in module ...

  2. 笨办法学Python记录--习题12-14 主要是pydoc用法,raw_input,argv

    20140413 -- 习题12 - 14 1. pydoc在windows的用法,必须进入到python安装目录,执行Python -m pydoc raw_input; 网上给出了一个好玩的,不过 ...

  3. Bullet:Python的函数中参数是引用吗?

    别的语言中关于函数有传值和传引用的区分. 关于此,流传很广的一个说法是 他们在现象的区别之一就是值传递后的变化,受到影响的就是引用,未受到影响的就是传值.   在学习中,也曾碰到过这个问题,网上关于这 ...

  4. python文档生成工具:pydoc、sphinx;django如何使用sphinx?

    文档生成工具: 自带的pydoc,比较差 建议使用sphinx 安装: pip install sphinx 安装主题: 由各种主题,我选择常用的sphinx_rtd_theme pip instal ...

  5. python之模块pydoc

    # -*- coding: cp936 -*- #python 27 #xiaodeng import pydoc #主要用于从python模块中自动生成文档,这些文档可以基于文本呈现,也可以生成we ...

  6. python中的pydoc

    在终端上输入pydoc会显示以下信息 pydoc - the Python documentation tool pydoc <name> ... Show text documentat ...

  7. [问题解决]Windows下python中pydoc命令提示“'pydoc' 不是内部或外部命令,也不是可运行的程序 或批处理文件。”

    解决方法:python -m pydoc 例:python -m pydoc print

  8. python 启动pydoc查看文档

    启动pydoc查看文档 python3 -m pydoc -p 访问http://localhost:6789 或者查看官方文档:https://seleniumhq.github.io/seleni ...

  9. Python 学习手册, char 14 - 15

    Char 14 迭代器和解析器 可迭代的 : 支持iter的一个对象 迭代器  : iter 所返回的一个支持next(I)的对象 Python迭代工具会自动调用这些函数,我们也可以手动地应用迭代协议 ...

随机推荐

  1. HDOJ-三部曲-1002-Etaoin Shrdlu

    ContestsProblemsRanklistStatusStatistics Etaoin Shrdlu Time Limit : 2000/1000ms (Java/Other)   Memor ...

  2. Comments

    Nothing can be quite so helpful as a well-placed comment.Nothing can clutter up a module more than f ...

  3. Canvas绘图API

    Canvas就是一个画布,可以进行任何的线.图形.填充等一系列的操作. Canvas的Context对象 要使用Canvas来绘制图形必须在页面中添加Canvas的标签 <canvas id=& ...

  4. swift SDWebImage使用

    Web image(网络图像) 该库提供了一个支持来自Web的远程图像的UIImageView类别它提供了: 添加网络图像和缓存管理到Cocoa Touch framework的UIImageView ...

  5. 破解 Rith's CrackMe #1(对比IDA查看动态分析中的MFC函数名)

    系统 : Windows xp 程序 : Rith's CrackMe #1 程序下载地址 :http://pan.baidu.com/s/1gecW9Qr 要求 : 注册机编写 使用工具 : IDA ...

  6. mysql的ERROR:1042

    在虚拟机上测试数据库备份功能,需要连接外部机器上的mysql,pdo总是报超时错误! 起初认为是用的mysql账号的域不匹配!后来发现不是因为这个! 在终端中用mysql命令尝试连接,发现返回的错误是 ...

  7. 如何编写一个编译c#控制台应用程序的批处理程序

    如何编写一个编译c#控制台应用程序的批处理程序 2011-03-22 18:14 dc毒蘑菇 | 浏览 579 次 最近在网上看了一个教程,是学C#的,但是我的机子上装不上vs,所以想写一个批处理来编 ...

  8. 通过.htaccess文件让Magento加速

    Magento提速的方法很多,通 过.htaccess文件开启GZip压缩可以非常明显的让Magento加速.在Magento初始安装中已经包含了.htaccess文件,我们只需 要把.htacces ...

  9. 基于 OpenSSL 的 CA 建立及证书签发 【转】

    建立 CA 建立 CA 目录结构 按照 OpenSSL 的默认配置建立 CA ,需要在文件系统中建立相应的目录结构.相关的配置内容一般位于 /usr/ssl/openssl.cnf 内,详情可参见 c ...

  10. dos快速通道

    要在文件夹的右键菜单中添加“命令提示符”选项.在注册表HKEY_CLASSES_ROOT\Directory\shell分支下新建一项“CommandPrompt”,修改右侧窗格中的“默认”键值为“命 ...