python module的结构

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

 

拿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 )

 

posted @ 2014-11-04 21:07  开开甲  阅读(457)  评论(0编辑  收藏  举报