Re: Empty string when reading a file

2009-04-05 Thread MRAB
nxri...@googlemail.com wrote: Hi, I'm reading in a file of 250 bytes. At the 55th byte, read() will return an empty string although this isn't the end of the file. This is what I have: for i in range(os.path.getsize("inputFile")): bitsInFile = inputFile.read(1) inputFile.seek(i) byt

Empty string when reading a file

2009-04-05 Thread nxri...@googlemail.com
Hi, I'm reading in a file of 250 bytes. At the 55th byte, read() will return an empty string although this isn't the end of the file. This is what I have: for i in range(os.path.getsize("inputFile")): bitsInFile = inputFile.read(1) inputFile.seek(i) byteFromFile = ord(bitsInFile) Rea