File Size Mystery??

brobbins333 at shaw.ca brobbins333 at shaw.ca
Thu Apr 11 21:43:37 EDT 2002


Five minutes after I posted the message I figured it out, but thanks
anyway. Old VB habits are hard to break.

BR 


On 12 Apr 2002 01:38:58 GMT, bokr at oz.net (Bengt Richter) wrote:

>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