![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
smartisong
这个作者很懒,什么都没留下…
展开
-
编程题:字符串压缩编码
字符串编码原创 2022-03-27 10:21:22 · 441 阅读 · 0 评论 -
Python读取二进制dat文件代码方法
在python中,读取二进制文件,需要用到struct包,而这个包里面的方法主要是unpack、pack、calcsize。详细介绍请看:Python 关于Struct 的官方文档。在编程语言中,一个float类型的数占4个字节。二进制数据转float类型,可以用struct.unpack()来实现。举个栗子:import structf = open('waveData.dat','rb')# 9600为文档中包含的数字个数,而一个浮点数占4个字节data_raw = struct.unpac原创 2021-09-25 19:48:33 · 2801 阅读 · 0 评论