摘要: server:# -*- coding:gb2312 -*-import socketimport timeif __name__ == "__main__": s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) host='' p... 阅读全文
posted @ 2014-06-07 16:43 sxcww 阅读(144) 评论(0) 推荐(0) 编辑
摘要: server:# -*- coding:gb2312 -*-import socketimport timeimport structif __name__ == "__main__": s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) ... 阅读全文
posted @ 2014-06-07 16:29 sxcww 阅读(215) 评论(0) 推荐(0) 编辑
摘要: In [8]: b=b'hello'In [9]: type(b)Out[9]: builtins.bytesIn [10]: s='hello'In [11]: type(s)Out[11]: builtins.strTo convert from str to bytes, use str.encode().: In [12]: a=str.encode(s)In [13]: t... 阅读全文
posted @ 2014-06-07 16:20 sxcww 阅读(169) 评论(0) 推荐(0) 编辑