python 工具 二进制文件处理之——去掉指定长度数据包头
2024-08-29 01:39:55
包头48bit 数据98464 。。。如此循环:
piece_size = 48
piece_size1 = 98464 with open("C:\\Users\\Administrator\\Desktop\\bins\\234.bin", "rb") as in_file, open("C:\\Users\\Administrator\\Desktop\\bins\\234_deal.bin", "ab+") as out_file:
while True:
piece = in_file.read(piece_size)
piece1= in_file.read(piece_size1)
if not piece:
break
if not piece1:
break
out_file.write(piece1)
in_file.close()
out_file.close() # f = open("C:\\Users\\Administrator\\Desktop\\bins\\OUT4.TXT", 'rb')
# while True:
# block = f.read(1024)
# print(block)
# if not block:
# break
# f.close()
最新文章
- c#语言规范
- SQLServer数据库备份
- android:id=";@+id/button1"; 与 android:id=";@id/button1"; 区别 @string
- Android照相机应用
- [转]Oracle学习记录 九 Prc C学习
- sql语句having子句用法,很多时候你曾忘掉
- android—资源文件(res)的引用
- windows server2012 图形加速,玩游戏不掉帧
- 1.3.2. App Icon 和 Launch Image(Core Data 应用程序实践指南)
- mysql常用基础操作语法(九)~~外连接查询【命令行模式】
- 补习系列(3)-springboot中的几种scope
- DeepLearning.ai-Week1-Convolution+model+-+Application
- Linux之awk、变量、运算符、if多分支
- Groovy与Java集成常见的坑
- HashMap几个需要注意的知识点
- Android APP通用型拒绝服务、漏洞分析报告
- Deployment failure on Tomcat 6.x. Could not copy all resources to D:\...\webapps\eptInfo. If a file is locked, you can wait until the lock times out to redeploy, or stop the server and redeploy, or ma
- [转载]浅析为什么char类型的范围是 —128~+127
- C#语法文本字面量
- 关于Mysql查询varchar类型错误问题
热门文章
- Apache ant 配置
- luogu3193 [HNOI2008]GT考试
- 学习boundingRectWithSize:options:attributes:context:计算文本尺寸
- 大数据学习——scala类相关操作
- WebService的简介, 原理, 使用,流程图
- Nginx+PHPSTORM+Xdebug 配置
- read(byte[] b)与readFully(byte[] b)
- xampp下bugfree部署
- 【Luogu】P2473奖励关(期望DP)
- 关于 __int128