python module的结构

时间:2014-11-04 22:32:57   收藏:0   阅读:313

python有很多module,下面是module的结构图:

bubuko.com,布布扣

 

拿httplib做例子,httlip module有:

4个class( HTTPConnection,HTTPSConnection,HTTPResponse,HTTPMessage ),

12个exception( HTTPException,NotConnected,InvalidURL,UnknownProtocol,UnknownTransferEncoding,UnimplementedFileMode,IncompleteRead,ImproperConnectionState,CannotSendRequest,CannotSendHeader,ResponseNotReady,BadStatusLine )

3个constant( HTTP_PORT,HTTPS_PORT,responses )

 

class会包含method和attribute(不一定有)

拿HTTPResponse做例子,HTTPResponse有:

4个method( read(),getheader(name[,default]),getheaders(),fileno() )

4个constant( msg,version,status,reason )

 

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!