python os.path.getsize different than len(f.read())
file, fread, python
Solution
`open(filename)` opens `filename` in text mode.
This means that every `\r\n` (carriage return, line feed) will be translated to a single `\n` in your Python string.
Seems like your file is 155 lines long.
Problem
I have a file file.txt doing ``` print os.path.getsize(filename) ``` outputs 6510 and doing ``` print len(open(filename).read()) ``` gets me 6355 how come ? i am using windows 7. if i look on the file properties in windows explorer it says Size: 6.35 KB (6,510 bytes)