Python任意字符串转16, 32, 64进制的方法 Python字符串转数字importbinasciis='test123456test'str_16=binascii.b2a_hex(s.encode('utf-8'))#字符串转16进制p 64进制