python 中的struct
摘要:
本文简单讲述python怎么生成和使用像C中的结构体先上代码# im_netio.pyimport socketimport struct# server addresshost = "172.16.100.136"port = 8100# headhead_len = 12version = 6def im_connect(): s = socket.socket() s.connect((host, port)) return sdef im_send(sock, pack): head = struct.pack('iii', head_len, le 阅读全文
posted @ 2012-08-24 16:02 jogger 阅读(337) 评论(0) 推荐(0) 编辑