hw_ctree.xml configuration in .bin?
can i put hw_ctree.xml in .bin file flasher to make epon at the same time load the configuration?本人不懂英文;顶贴。 you need to convert file content in hw_ctree.xml to binary data as output.bin
Python:
import struct
# to write in
data_to_write = "file content"#file content of hw_ctree.xml
# open .bin to write
with open("output.bin", "wb") as bin_file:
# to binary
binary_data = data_to_write.encode('utf-8')
# to .bin
bin_file.write(binary_data)
#So do game over import struct
with open('hw_ctree.xml', 'r') as file:
content = file.read()
binary_data = content.encode('utf-8')
with open('output.bin', 'wb') as bin_file:
bin_file.write(binary_data) zhang260gt 发表于 2024-11-14 03:35
import struct
with open('hw_ctree.xml', 'r') as file:
content = file.read()
whats this what app python 转二进制。厉害了
页:
[1]