cvw/tests/linux-testgen/linux-testvectors/convert2bin.py

14 lines
284 B
Python
Executable File

#!/usr/bin/python3
asciiBinFile = 'ram.txt'
binFile = 'ram.bin'
asciiBinFP = open(asciiBinFile, 'r')
binFP = open (binFile, 'wb')
for line in asciiBinFP.readlines():
binFP.write(int(line, 16).to_bytes(8, byteorder='little', signed=False))
asciiBinFP.close()
binFP.close()