Hi,
I want to know how to read the binary file from 10th byte to 90th byte in a file size of 100 bytes and need to write the read data into new binary file.
please help me in doing this.
hisan
12
Light Poster
Recommended Answers
Jump to Postwith open('binfile.dat', 'rb') as bf: bf.seek(10) open('out.dat', 'wb').write(bf.read(80))
Something like this. This is untested as I am not with computer now. Maybe you must seek(9) and/or read(81).
All 3 Replies
TrustyTony
888
pyMod
Team Colleague
Featured Poster
woooee
814
Nearly a Posting Maven
hisan
12
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.