2013年4月25日
摘要: python中,想查看某个模块的源码位置:import 模块名help(模块名),在其中有个file项,就是源码或者dll的位置或者:模块名.__file__例如:import sockethelp(socket)或者socket.__file__>>> import socket>>> socket.__file__'D:\\Python32\\lib\\socket.py'可知,其源码在D:\Python32\lib中的socket.py文件中。打开socket.py发现,其中并没有诸如socket(),accept(),listen() 阅读全文
posted @ 2013-04-25 15:41 101010 阅读(2027) 评论(0) 推荐(0) 编辑
摘要: 1.PyMethodDef结构体源码(Include/methodobject.h):typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);struct PyMethodDef { const char *ml_name; /* The name of the built-in function/method */ PyCFunction ml_meth; /* The C function that implements it */ int ml_flags; /* Combinat... 阅读全文
posted @ 2013-04-25 14:38 101010 阅读(3347) 评论(0) 推荐(0) 编辑
摘要: 详细内容见:http://docs.python.org/3/library/socket.html1.属性AF_UNIX,AF_INET,AF_INET6SOCK_STREAM,SOCK_DGRAM2.异常errorherrorgaierrortimeout3.函数socket()socketpair()fromfd()4.数据属性ssl()getaddrinfo()getnameinfo()getfqdn()gethostname()gethostbyname()gethostbyname_ex()gethostbyaddr()getprotobyname()getservbyname() 阅读全文
posted @ 2013-04-25 01:04 101010 阅读(309) 评论(0) 推荐(0) 编辑