Python处理二进制流应该怎么写,Python处理二进制流,我现在读取了芯片的数据,
Python处理二进制流应该怎么写,Python处理二进制流,我现在读取了芯片的数据,
我现在读取了芯片的数据,但是它是二进制流。我想把它print出来,怎么处理呢?
struct模块中的pack和unpack函数.
之前模仿java的Bytebuffer写的一个读取/写入 字节数组的类,希望对你有帮助
https://github.com/hongliuliao/jafka-python-client/blob/master/src/jafka_utils.py
binascii — Convert between binary and ASCII
binascii.b2a_hex(data)
binascii.hexlify(data)
Return the hexadecimal representation of the binary data. Every byte of data is converted into the corresponding 2-digit hex representation. The resulting string is therefore twice as long as the length of data.
binascii.a2b_hex(hexstr)
binascii.unhexlify(hexstr)
Return the binary data represented by the hexadecimal string hexstr. This function is the inverse of b2a_hex(). hexstr must contain an even number of hexadecimal digits (which can be upper or lower case), otherwise a TypeError is raised.
struct模块可以对二进制数据进行解析和封装的功能,参考:
http://blog.guozengxin.cn/2013/07/25/python-struct-pack-unpack/
基因芯片吗?affy的cel文件可以用r来读的。
编橙之家文章,
相关内容
- Python判读变量是否定义用什么方法,python判读变量定义
- Python webpy模板变量可以遍历两次吗?为什么我的方法不行
- python处理小文件读写并行的一些疑惑,python读写,我有大
- python threading线程再次开启多线程AttributeError错误应对方
- WEB应用Python比PHP更适合吗,,我记得以前看过一篇文章,
- 贴个python源码求分析,微信第三方接口无法为客户端返回
- 提升Python编程能力有什么方法,提升python编程能力,我是
- 一个页面中的这两个信息能不用python无头浏览器爬取到
- Python菜鸟对类应用的问题求助,python菜鸟问题求助,cl
- Python如何实现点阵造字,python点阵造字,刚刚嵌入式老师
评论关闭