Format file size for printing

Fuzzyman fuzzyman at gmail.com
Mon Feb 20 05:11:26 EST 2006


abcd wrote:
> is there a built-in way of printing the size of a file nicely?
>
> So if the file size is 103803 bytes it prints out like: 103.8K
> or
> 0.1MB
>
> something liek that?

Pathutils (small extension module - not builtin) contains a basic
function that does this.

    http://www.voidspace.org.uk/python/pathutils.html

All the best,


Fuzzyman
http://www.voidspace.org.uk/python/index.shtml




More information about the Python-list mailing list