【python将txt转16进制】,情人节对对碰(python txt转bin)
0evadmin
编程语言
9
文件名:【python将txt转16进制】,情人节对对碰
【python将txt转16进制】
python将txt转16进制 直接上代码 import timeprint("begin")#读取的txt文件infile = open("xxx.txt","r");#outfile = open("xxx.hex","wb");#开始读文件a = infile.read(1);_combine = "";i=0;while a != '\n':if ' ' == a:a = infile.read(1);continue;else:_combine = _combine + a;i = i+1;if 2 == i :i = 0;#转化为16进制outfile.write(bytes.fromhex(_combine));_combine = "";a = infile.read(1);infile.close();outfile.close();print("getit")
同类推荐
-

【Python 标准库学习】安全哈希与摘要算法库 — hashlib,索爱w850i
查看 -

【Python】Pyinstaller打包Linux运行文件,暴露配置文件,泡泡手机网(python打包linux应用)
查看 -

【Python】Python Mako模板使用,武尊神
查看 -

【Python】Python 中的Docutils模块详解,诺亚舟搜学王
查看 -

【Python】Python 使用copy模块深拷贝对象,索爱w850
查看 -

【Python】Python 利用模块实现单例模式,谷歌音乐搜索
查看 -

【Python】Python给工作减负-读Excel文件生成xml文件,黛芙薇尔让我祛斑成功
查看 -

【Python】ffmpeg模块处理视频、音频信息,冰激凌智屏(python ffmpeg模块)
查看 -

【Python】plt库详解和示例,索爱w810c(索爱p802)
查看