reading in ints from binary files
metaliu at yahoo.com
Mon Mar 25 19:58:53 CET 2002
Quick Newb question:
How do I read in integers from binary files? readlines() reads returns the
data in as a string. I can manipulate the string to get the desired result.
However, is there an easier way of doing this? I currently do something
s = f.readline()
l = list(s[0:-1])
a = array.array('h', ''.join(l))
There's gotta be an easier way.
Thanks in advance,
More information about the Python-list