Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- #definisco funzione per human readable size
- def sizeof_fmt(num):
- for x in ['bytes','KB','MB','GB','TB']:
- if num < 1024.0:
- return "%3.1f%s" % (num, x)
- num /= 1024.0
- grand_total = 0
- file_with_sizes = open(sys.argv[1])
- for line in file_with_sizes:
- curr_file_size=os.path.getsize( line.strip() )
- grand_total += curr_file_size
- print "Total is " + str( sizeof_fmt(grand_total) )
Add Comment
Please, Sign In to add comment