python partition_to_bin.py
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python partition_to_bin.py相关的知识,希望对你有一定的参考价值。
#!/usr/bin/env python3
#
# Dump bootgen_utility generated partition data to a binary file
#
# Example usage:
# $ bootgen_utiliy -bin BOOT.bin -out boot_out
# $ ./partition_to_bin.py < boot_out_partition_1.txt > part1.bin
#
import binascii
import fileinput
import sys
lines = sys.stdin.readlines()
hexbytes = bytes.fromhex(lines[4].replace('0x', ''))
sys.stderr.write("hexdata length = {}\n".format(len(hexbytes)))
for i in hexbytes:
sys.stdout.buffer.write(i.to_bytes(1, byteorder='big'))
#print("0x{:02x}".format(i))
以上是关于python partition_to_bin.py的主要内容,如果未能解决你的问题,请参考以下文章
Python代写,Python作业代写,代写Python,代做Python
Python开发
Python,python,python
Python 介绍
Python学习之认识python
python初识