资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

python查看文档的方式有哪些-创新互联

创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!

创新互联专注于企业成都全网营销、网站重做改版、淮安网站定制设计、自适应品牌网站建设、H5网站设计商城开发、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为淮安等各大城市提供网站开发制作服务。

python查看文档的方式有哪些?这个问题可能是我们日常学习或工作经常见到的。希望通过这个问题能让你收获颇深。下面是小编给大家带来的参考内容,让我们一起来看看吧!

help

在交互模式下,help函数是获取文档的好帮手,使用非常简单。

>>> 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__是每个对象都有的属性,其存放了对象文档。

>>> 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时会自带一个chm格式的离线文档Python documention,该文档的信息比较全。

python查看文档的方式有哪些离线模块文档

Python针对模块还有一个单独的文档,该文档在浏览器中查看。

python查看文档的方式有哪些在线文档

在浏览器打开https://docs.python.org/3.4/

感谢各位的阅读!看完上述内容,你们对python查看文档的方式有哪些大概了解了吗?希望文章内容对大家有所帮助。如果想了解更多相关文章内容,欢迎关注创新互联-成都网站建设公司行业资讯频道。


本文名称:python查看文档的方式有哪些-创新互联
文章来源:http://cdkjz.cn/article/cceojd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220