python pydoc模块生成html网页版内容
pydoc 是一个能生成网页版的模块,内置模块
命令:
python -m pydoc -p 1234
-m 加载模块
-p 网页访问端口
命令行:
b 打开浏览器
q 退出
效果:
Windows环境下:
python -m pydoc -w atexit //在当前目录创建atexit.html python -m pydoc -p 5000 //启动一个Web服务器监听http://localhost:5000/
Linux环境下:
pydoc -w atexit pydoc -p 5000
说明&参数:
python3 -m pydoc
pydoc - the Python documentation tool pydoc <name> ... Show text documentation on something. <name> may be the name of a Python keyword, topic, function, module, or package, or a dotted reference to a class or function within a module or module in a package. If <name> contains a '/', it is used as the path to a Python source file to document. If name is 'keywords', 'topics', or 'modules', a listing of these things is displayed. pydoc -k <keyword> Search for a keyword in the synopsis lines of all available modules. pydoc -p <port> Start an HTTP server on the given port on the local machine. Port number 0 can be used to get an arbitrary unused port. pydoc -b Start an HTTP server on an arbitrary unused port and open a Web browser to interactively browse documentation. The -p option can be used with the -b option to explicitly specify the server port. pydoc -w <name> ... Write out the HTML documentation for a module to a file in the current directory. If <name> contains a '/', it is treated as a filename; if it names a directory, documentation is written for all the contents.
--
参考:
https://baijiahao.baidu.com/s?id=1747269705228787388&wfr=spider&for=pc
http://www.manongjc.com/detail/51-wxogbwvataghipj.html
分类:
Python & Jython
标签:
python
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!