import struct with open("case_6.in", "rb") as f: for i in range(1000): c = struct.unpack("f", f.read(4))[0] print(c)