I am working with a binary file. and want to split a binary number to smaller parts.
For example an input number 01001100001011000100110000101100010011000
should be parsed to 0 1 00 11 0000 1 0 11 000 1 00 11 0000 1 0 11 000 1 00 11 000
.
This is what I have tried so far?
from tkinter import filedialog
file_path = filedialog.askopenfilename()
with open(file_path, 'rb') as f:
a = f.read
print(a.replaceint("01", "0 1"))
print(a.replaceint("10", "1 0"))
print(f, file=open("space.txt", "a"))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…