stripping the first byte from a binary file
jeremy+complangpython at jeremysanders.net
Tue Jul 10 12:37:02 CEST 2007
> Would someone mind showing me how to strip the first byte from a
> binary file? For some reason I can't figure this out from the binary
> file editing examples I've read. Thanks.
Do you mean something like this?
f = open('test.dat', 'rb')
f.read(1) # read 1st byte and ignore it
rest = f.read() # read rest
data = f.read()
data = data[1:] # skip 1st byte
More information about the Python-list