File Size Mystery??

Bengt Richter bokr at oz.net
Thu Apr 11 21:38:58 EDT 2002


On Fri, 12 Apr 2002 01:18:56 GMT, brobbins333 at shaw.ca wrote:

>this is foofile.txt (created in Windows Notepad):
>ur75ht8495u7475ht89302oskv476830rj
 01234567890123456789012345678901234
           1         2         3
>
>and here is what Python tells me about it:
>
>
>>>> print os.path.getsize('foofile.txt')
>34
>>>> print len('foofile.txt')
                012345678901
                          1
>11
>
>
>os.path.getsize() returns the correct size of the file, 
>but len() does not. Why is there a discrepancy?
>
;-)

Regards,
Bengt Richter



More information about the Python-list mailing list