python怎么处理二进制流
怪我咯
怪我咯 2017-04-17 13:42:37
[Python讨论组]

我现在读取了芯片的数据,但是它是二进制流。我想把它print出来,怎么处理呢?

怪我咯
怪我咯

走同样的路,发现不同的人生

全部回复(3)
迷茫

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.

PHPz

struct模块中的pack和unpack函数.

天蓬老师

基因芯片吗?affy的cel文件可以用r来读的。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号