Python
来源:互联网 发布:Java 优化网站 编辑:程序博客网 时间:2024/05/16 14:04
要点
import binasciihex_digits = binascii.b2a_hex(bin_stream)
生成一个二进制文件
$ 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.dat00000000 48 ad 45 ec 34 14 48 20 1d e2 |H.E.4.H ..|0000000a
binascii
>>> 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'>>>
阅读全文
0 0
- Python
- Python
- Python
- python
- Python
- PYTHON
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- python
- Python
- 岛屿的数量 51Nod
- 快速幂讲解
- C++模板及用模板实现双向循环链表,顺序表
- MySQL数学函数大全
- 单链表(头指针)
- Python
- HAXM installer NOT compatible with windows 的解决方法
- javascript(一)
- Hive 自定义函数函数
- 51nod 1001 数组中和等于K的数对
- 【JAVA】HDU 1312 Red and Black(DFS水题)
- 农夫约翰为了修理栅栏,要将一块很长的木块切割成N块,准备切成的木板的长度为L1,L2...LN,未切割前的木板的长度恰好为切割后木板的长度的总和,每次切断木板的时候,需要的开销为这块木板的长度,例如长
- 2017第三次多校联合hdu6060
- C++学习(1)