Python TCP socket,解析hex和字符串。
#!/usr/bin/env python#coding:utf-8from socket import *import chardetdef shuncomdacode(data): """ 识别data的编码格式 """ result = chardet.detect(data) print(result['encoding']) return (result['encoding'])def connetSocket(host,port,decode_he