新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
創(chuàng)新互聯(lián)Python教程:python文檔怎么看
查看文檔是一個(gè)程序員的基本功,這里簡(jiǎn)單介紹幾種查看python文檔的方法,下面以struct模塊為例。

我們提供的服務(wù)有:網(wǎng)站制作、成都網(wǎng)站建設(shè)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、汝陽(yáng)ssl等。為近千家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢(xún)和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的汝陽(yáng)網(wǎng)站制作公司
help
在交互模式下,help函數(shù)是獲取文檔的好幫手,使用非常簡(jiǎn)單。
>>> import struct >>> help(struct) Help on module struct: NAME struct DESCRIPTION Functions to convert between Python values and C structs. Python bytes objects are used to hold the data representing the C struct and also as format strings (explained below) to describe the layout of data in the C struct. The optional first format char indicates byte order, size and alignment: @: native order, size & alignment (default) =: native order, std. size & alignment <: little-endian, std. size & alignment >: big-endian, std. size & alignment !: same as > The remaining chars indicate types of args and must match exactly; these can be preceded by a decimal repeat count: x: pad byte (no data); c:char; b:signed byte; B:unsigned byte; ?: _Bool (requires C99; if not available, char is used instead) h:short; H:unsigned short; i:int; I:unsigned int;
__doc__
__doc__是每個(gè)對(duì)象都有的屬性,其存放了對(duì)象文檔。
>>> import struct >>> struct.__doc__ "Functions to convert between Python values and C structs.\nPython bytes objects are used to hold the data representing the C struct\nand also as format string s (explained below) to describe the layout of data\nin the C struct.\n\nThe optional first format char indicates byte order, size and alignment:\n @: native o rder, size & alignment (default)\n =: native order, std. size & alignment\n <: little-endian, std. size & alignment\n >: big-endian, std. size & alignment\n !: same as >\n\nThe remaining chars indicate types of args and must match exactly;\nthese can be preceded by a decimal repeat count:\n x: pad byte (no data) ; c:char; b:signed byte; B:unsigned byte;\n ?: _Bool (requires C99; if not available, char is used instead)\n h:short; H:unsigned short; i:int; I:unsigned in t;\n l:long; L:unsigned long;
離線文檔
安裝Python時(shí)會(huì)自帶一個(gè)chm格式的離線文檔Python documention,該文檔的信息比較全。
離線模塊文檔
Python針對(duì)模塊還有一個(gè)單獨(dú)的文檔,該文檔在瀏覽器中查看。
在線文檔
在瀏覽器打開(kāi)https://docs.python.org/3.4/
當(dāng)前文章:創(chuàng)新互聯(lián)Python教程:python文檔怎么看
標(biāo)題路徑:http://m.fisionsoft.com.cn/article/ccoigdp.html


咨詢(xún)
建站咨詢(xún)
