嗨,我想在没有循环的情况下将十六进制值转换为十进制(因为“速度”问题)
ex)
>>> myvalue = "\xff\x80\x17\x90\x12\x44\x55\x99\x90\x12\x80"
>>> int(myvalue)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '\xff\x80\x17\x90\x12DU\x99\x90\x12\x80'
>>> ord(myvalue)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ord() expected a character, but string of length 11 found
>>>
有人帮忙吗?