How to find size of file?

Iñigo Serna inigoserna at terra.es
Sat Mar 6 07:28:27 EST 2004


Hi,

Other ways:

>> import os, stat 
>> os.stat(filename)[stat.ST_SIZE]

Or better:

>> import os.path
>> os-path.getsize(filename)

Best regards,
Iñigo Serna

El vie, 05-03-2004 a las 22:13, Walter Huf escribió:
> Yermat <loic at yermat.net1.nerim.net> wrote in
> news:c2ai0g$1t4u$1 at biggoron.nerim.net: 
> 
> > Walter Huf a écrit :
> 
> > def sizeOf(f):
> >      f.seek(0,2)
> >      return f.tell()
> > 
> 
> Thank you!
> 
> 
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 100,000 Newsgroups - 19 Different Servers! =-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Esta parte del mensaje est? firmada	digitalmente
URL: <http://mail.python.org/pipermail/python-list/attachments/20040306/d61a7ad1/attachment.sig>


More information about the Python-list mailing list