python - How to read complete file with bitstring -
i want read many 24 bit chunks possible file. how can using bitstrings' constbitstream when don't how many chunks there are?
currently this:
eventlist = constbitstream(filename = 'events.dat') in range(1000) : packet = eventlist.read(24) (here have calculate number of events beforehand)
you read until readerror exeption generated
try: while true: packet = eventlist.read(24) except readerror: pass
Comments
Post a Comment