I\'m trying to read a binary file and am getting confusing results.
f = open(\'foo.dat\',\'r\') data = f.read() print len(data), f.tell()
data is a str object, thus len(data) tells you about the length of this string, not the file length in bytes.
data
str
len(data)