def _du(real_path):
 total_size = 0
 if os.path.isdir(real_path):
  for (dirpath, dirnames, filenames) in os.walk(real_path):
   for filename in filenames:
    total_size += os.path.getsize(os.path.join(dirpath, filename))
 else:
  total_size += os.path.getsize(real_path)
 return total_size

def _du ( real_path ) : total_size = 0 if os . path . isdir ( real_path ) : for ( dirpath , dirnames , filenames ) in os . walk ( real_path ) : for filename in filenames : total_size += os . path . getsize ( os . path . join ( dirpath , filename ) ) else : total_size += os . path . getsize ( real_path ) return total_size
get total size of file or files in dir .