def getdirsize(dirpath): size = 0 for root, dirs, files in os.walk(dirpath): size += sum([getsize(join(root, name)) for name in files]) return size
def getdirsize(dirpath): size = 0 for root, dirs, files in os.walk(dirpath): size += sum([getsize(join(root, name)) for name in files]) return size