附件是一本书的内容,发现其中有些字母莫名地大写
cat 文件名 | grep -Eo ‘[A-Z]’ |tr -d ‘\n’
# -*- coding: utf-8 -*-
import re
s='010000100100100101010100010100110100001101010100010001100111101101101000001100010110010000110011010111110011000101101110010111110111000001101100001101000011000101101110010111110011010100110001001101110011001101111101'
s3 = ''
s4 = re.findall('.{8}',s)
print ('每一个hex分隔:',s4)
for i in s4:
s3 += chr(int(i,2))
print ('ID:',s3)
注意是几个01一起打包,二进制转字符串
http://www.txttool.com/WenBen_BinaryStr.asp