bit parsing from file

rewonka at gmail.com rewonka at gmail.com
Thu May 29 10:42:07 EDT 2008


Hello,

I'm tring to make a cutting script.
The problem is the following, i have a sample pattern, for
example :'11101110' (0xEE)
That is the sign of the data begining.
How can i cut a file if the byte stepping is not the same, for
example:

file=open('test.bin','rb')
data=file.read()
print binascii.hexlify(data)            # BB9A (1011101110011010)
file.close()

so i need to cut the first two bit and start to writeout the bit
stream to another file
If somebody have an idea to do this, please share with me.
Thanx

Rew



More information about the Python-list mailing list