当前位置: 首页 > news >正文

企业网站怎么做优化/快速网站推广公司

企业网站怎么做优化,快速网站推广公司,杭州专业网站设计制作,微信公众号登录电脑版在Python中有很多很好的工具来生成字符串文档(docstring),比如说: epydoc、doxygen、sphinx,但始终觉得pydoc还是不错的工具,用法非常简单,功能也算不错,本文主要介绍pydoc. pydoc是Python自带的模块,主要…

在Python中有很多很好的工具来生成字符串文档(docstring),比如说: epydoc、doxygen、sphinx,但始终觉得pydoc还是不错的工具,用法非常简单,功能也算不错,本文主要介绍pydoc.

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

用法

Windows下:

D:\>python -m pydoc <modulename>   # 比如说: python -m pydoc math  

-m参数:Python以脚本的方法运行模块


Linux/Unix下:

$ pydoc <modulename>               # 比如说: pydoc 
帮助
$ pydoc -h
pydoc - the Python documentation toolpydoc <name> ...Show text documentation on something.  <name> may be the name of aPython keyword, topic, function, module, or package, or a dottedreference to a class or function within a module or module in apackage.  If <name> contains a '/', it is used as the path to aPython 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.pydoc -w <name> ...Write out the HTML documentation for a module to a file in the currentdirectory.  If <name> contains a '/', it is treated as a filename; ifit names a directory, documentation is written for all the contents.
参数 -p 】在本地机器上,按照给定的端口启动HTTP,

D:\>python -m pydoc -p 1234 #比如说: 端口为1234

pydoc server ready at http://localhost:1234/

pydoc server stopped

在IE中输入:http://localhost:1234/,效果如图:


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

$ pydoc -k xml.sax
xml.sax (package) - Simple API for XML (SAX) implementation for Python.
xml.sax._exceptions - Different kinds of SAX Exceptions
xml.sax.expatreader - SAX driver for the pyexpat C module.  This driver works with
xml.sax.handler - This module contains the core classes of version  2.0 of SAX for Python.
xml.sax.saxutils - A library of useful helper classes to the SAX classes, for the
xml.sax.xmlreader - An XML Reader is the SAX 2 name for an XML parser. XML Parsers
参数 -w 】将指定模块的文本字符串生成HTML格式

比如说,在Window下面,执行下面命令:

D:\Learn\Python>python -m pydoc math -w math.html  # math是模块名,-w:写
那么在D:\Learn\Python目录下会生成math.html文件,显示如下:


因为是自带的模块,所以右上角显示(built-in)字样

例子】自写的模块my_doc.py

'''
Showoff features of Pydoc module
This is easy module to demonstrate docstrings
'''
__authors__  = 'Alice & Fred'
__version__  = 'version 1.10'
__license__  = 'Copyright...'class MyClass:'''Demonstrate Class Docstrings'''def __init__(self, spam=1, eggs=2):'''Set the default attributevalues onlyKeyword arguments:spam - a processed meat producteggs - a fine breakfast for lumberjacks'''self.spam = spamself.eggs = eggsdef square(x):'''Square of the param <x>'''return x * x
执行命令:
D:\Learn\Python> python -m pydoc my_doc
执行结果:
Help on module my_doc:NAMEmy_docFILEd:\learn\python\my_doc.pyDESCRIPTIONShowoff features of Pydoc moduleThis is easy module to demonstrate docstringsCLASSESMyClassclass MyClass|  Demonstrate Class Docstrings||  Methods defined here:||  __init__(self, spam=1, eggs=2)|      Set the default attributevalues only|      Keyword arguments:|      spam - a processed meat product|      eggs - a fine breakfast for lumberjacksFUNCTIONSsquare(x)Square of the param <x>DATA__authors__ = 'Alice & Fred'__license__ = 'Copyright...'__version__ = 'version 1.10'VERSIONversion 1.10
执行命令:
d:\Learn\Python>python -m pydoc -w my_doc my_doc.html
wrote my_doc.html
no Python documentation found for 'my_doc.html'
执行结果:



官方文档:

https://docs.python.org/2/library/pydoc.html 


http://www.lbrq.cn/news/771427.html

相关文章:

  • 北京网站建设首选小峰/网站友情链接连接
  • 网站建设设计流程步骤/seo综合查询怎么进入网站
  • 建造网站的软件/青青河边草直播免费观看
  • 如何在行业门户网站上做推广/百度搜索工具
  • 公司网站的服务费做哪个科目/邯郸百度推广公司
  • 公司网站经典案例/google权重查询
  • 网站的备案要求/利尔化学股票股吧
  • 现在还有人用asp做网站/色盲测试
  • 局域网内网站建设的步骤过程/友情链接收录
  • 怎样制作做实景的网站/百度竞价规则
  • wordpress 官方网站/软件测试培训费用大概多少
  • 网站列表页模板/今日热点新闻事件摘抄
  • 网站设计工程师是it行业吗/交换链接的例子
  • 网站建设团队架构/如何开一个自己的网站
  • 谷歌有趣的网站/竞价推广哪里开户
  • 做返利网站/chatgpt网页
  • 注册代理公司/长沙网站seo优化
  • 免费网站建站手机/免费的推文制作网站
  • 近期热点舆情事件/seo广州工作好吗
  • 池州网站建设费用/天津优化代理
  • 开发公司支付前期物业开办费包括哪些内容/菏泽地网站seo
  • 九江企业网站制作/seo教程搜索引擎优化入门与进阶
  • 有什么国外的黄网站/百度指数查询工具
  • 做网站先做前端好还是先做逻辑/淘客推广怎么做
  • asp.net 如何设置网站首页/网站流量排行
  • 郑州做网站公司电话/查关键词热度的网站
  • 河北网站建设价格大全/利尔化学股票
  • 小米果怎么做视频网站/低价刷粉网站推广
  • 公司网站集群系统架构及建设思路/苏州seo网站公司
  • 卡密提取网站怎么做/杭州seo网站优化公司
  • k8s资源管理
  • 图论理论部分
  • LeetCode Day5 -- 栈、队列、堆
  • golang的继承
  • SQL Server增加对UTF-8的支持
  • 机械臂的智能升维:当传统机械臂遇见Deepoc具身智能大模型从自动化工具到具身智能体的范式革命