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

青岛外贸建设网站制作常用的网络推广方法

青岛外贸建设网站制作,常用的网络推广方法,discuz培训网站模板下载,西安市社交网站制作公司在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 # 比如说: python -m pydoc math

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

Linux/Unix下:

$ pydoc # 比如说: pydoc

【帮助】

$ pydoc -h

pydoc - the Python documentation tool

pydoc ...

Show text documentation on something. 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 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

Search for a keyword in the synopsis lines of all available modules.

pydoc -p

Start an HTTP server on the given port on the local machine.

pydoc -w ...

Write out the HTML documentation for a module to a file in the current

directory. If contains a '/', it is treated as a filename; if

it 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/,效果如图:

201562170253630.png?20155217355

【参数 -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文件,显示如下:

201562170406459.png?20155217414

因为是自带的模块,所以右上角显示(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 only

Keyword arguments:

spam - a processed meat product

eggs - a fine breakfast for lumberjacks

'''

self.spam = spam

self.eggs = eggs

def square(x):

'''''

Square of the param

'''

return x * x

执行命令:

D:\Learn\Python> python -m pydoc my_doc

执行结果:

Help on module my_doc:

NAME

my_doc

FILE

d:\learn\python\my_doc.py

DESCRIPTION

Showoff features of Pydoc module

This is easy module to demonstrate docstrings

CLASSES

MyClass

class 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 lumberjacks

FUNCTIONS

square(x)

Square of the param

DATA

__authors__ = 'Alice & Fred'

__license__ = 'Copyright...'

__version__ = 'version 1.10'

VERSION

version 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'

执行结果:

201562170426640.png?20155217434

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

相关文章:

  • 在手机上怎么赚钱博客seo怎么做
  • 如何对网站做压力测试抖音关键词搜索排名收费
  • 做网站都需要准备什么网络推广培训课程内容
  • 如何制作课程网站模板下载微信运营
  • 做动画网站郑州seo优化顾问热狗
  • 网络建设可行性分析怀化网站seo
  • 社交网站设计附近成人电脑培训班
  • 扬州网站建设制作有了域名怎么建网站
  • 武汉微信网站建设站长之家网站流量查询
  • 佛山顺德容桂网站制作关键词网站排名查询
  • 威海专业网站建设营销软文范例大全100
  • 项目经理职责及工作范围搜索引擎优化的方法与技巧
  • 门户网站的定义百度指数使用方法
  • 静态网站做301重定向百度教育网站
  • 做韩国护的网站天津网站建设公司
  • 网站开发会计处理百度一下你就知道搜索引擎
  • 可以做女鞋批发的网站南宁网站seo大概多少钱
  • 郑州做网站七彩科技产品市场调研怎么做
  • 网站联系方式连接怎么做seo薪资水平
  • 怎么做公司销售网站武汉seo排名
  • smarty做网站软文发布网站
  • 网站设计概述广告公司
  • 下载应用商店app玉林网站seo
  • 天津七七一网站建设有限公司怎么样淘宝推广引流方法有哪些
  • 公司网站后台怎么上传视频精准营销
  • 鲜花外贸网站建设百度广告投放
  • 广宏建设集团有限公司网站seo刷排名公司
  • 柬埔寨美女教你用母乳做奶茶原网站seo关键词优化举例
  • 企业网站酷站网站关键词排名优化
  • 网上做涉黄网站怎么判厦门seo百度快照优化
  • 2025 蓝桥杯C/C++国B 部分题解
  • Springboot2+vue2+uniapp 小程序端实现搜索联想自动补全功能
  • 【算法训练营Day22】回溯算法part4
  • C++ - 仿 RabbitMQ 实现消息队列--案例
  • Spring AOP动态代理核心原理深度解析 - 图解+实战揭秘Java代理设计模式
  • cacti