Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open("bin-file", "rb") as f:
- for line in f:
- # Here I deal with every line
- import struct
- unpack_str = '=?iiiiiiii...' # The actual string contains 739 i's
- n_bytes = 2957 # There are 2957 bytes per line
- with open("bin-file", "rb") as f:
- line_bin = f.read(n_bytes)
- line_str = struct.unpack(unpack_str,line_bin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement