python int, long, 字符串 等相互转换
16进制字符串转10进制整数:
1 2 3 4 5 6 7 8 9 10 |
>>> int(0xff) 255 >>> int('0xff') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: '0xff' >>> int('0xff',16) 255 >>> long(0x55) 85L |
10进制整数 […]