python 十六进制打印收集

python3 三种字符串(无前缀,前缀u,前缀b)与encode()
https://blog.csdn.net/anlian523/article/details/80504699

Python - 二进制码流的十六进制字符串
https://blog.csdn.net/a_flying_bird/article/details/76694211

$ dd if=/dev/random of=test.dat bs=5 count=2
记录了2+0 的读入
记录了2+0 的写出
10 bytes copied, 9.6496e-05 s, 104 kB/s
$ hexdump -C test.dat
00000000  48 ad 45 ec 34 14 48 20  1d e2                    |H.E.4.H ..|
0000000a

log

>>> import binascii
>>> f=open("test.dat", "rb")
>>> bin = f.read()
>>> f.close()
>>> bin
'H\xadE\xec4\x14H \x1d\xe2'
>>> hex = binascii.b2a_hex(bin)
>>> hex
'48ad45ec341448201de2'
>>> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值