How can I find out the size of a file

momobear wgwigw at gmail.com
Thu Mar 29 02:32:23 CEST 2007


On Mar 29, 6:09 am, Marko.Cain... at gmail.com wrote:
> Hi,
>
> How can I find out the size of a file in a disk in python?
>
> i try this, but it does not work:
>  size = open(inputFileNameDir + "/" + file, 'r').size()
>
> Thank for any help.

os.stat(filename),
see stat manual for detail.(st_size )




More information about the Python-list mailing list