【发布时间】:2018-11-11 19:42:13
【问题描述】:
我想像这样计算字符串“\x00”:
\x01 , \x02 , \x03 , \x04 .... \xff ,然后再次 \x00 ... 等等。
但我不知道该怎么做。
我尝试过类似的方法:
counter= "\x00"
for i in range(1, 2000):
counter= int(counter,16) +1
但它显然不起作用:int() 的无效文字,基数为 16:'\x00'
我希望你们有更好的主意。非常感谢!
【问题讨论】:
-
您使用的是哪个版本的 Python?
标签: python string hex counting