def get_tree_size(start_path):
 if (not os.path.exists(start_path)):
  raise ValueError(('Incorrect path: %s' % start_path))
 total_size = 0
 for (dirpath, dirnames, filenames) in os.walk(start_path):
  for f in filenames:
   fp = os.path.join(dirpath, f)
   total_size += os.path.getsize(fp)
 return total_size

def get_tree_size ( start_path ) : if ( not os . path . exists ( start_path ) ) : raise ValueError ( ( 'Incorrect path: %s' % start_path ) ) total_size = 0 for ( dirpath , dirnames , filenames ) in os . walk ( start_path ) : for f in filenames : fp = os . path . join ( dirpath , f ) total_size += os . path . getsize ( fp ) return total_size
return size of filesystem tree .