【发布时间】:2015-04-10 07:57:04
【问题描述】:
我遇到了 Python2 和 Python3 之间的奇怪差异。当使用 Python3 打印相同的字符列表时,会产生一个额外的字节 C2。我会期待同样的行为。 Python2 的行为符合我的预期。我在这里错过了什么?
$ python3 -c "print('\x30\xA0\x04\x08')" | xxd
0000000: 30c2 a004 080a
$ python2 -c "print('\x30\xA0\x04\x08')" | xxd
0000000: 30a0 0408 0a
【问题讨论】:
标签: python python-3.x python-2.x