def get_folder_size(path):
 if os.path.exists(path):
  return flt(subprocess.check_output([u'du', u'-ms', path]).split()[0], 2)

def get_folder_size ( path ) : if os . path . exists ( path ) : return flt ( subprocess . check_output ( [ u'du' , u'-ms' , path ] ) . split ( ) [ 0 ] , 2 )
returns folder size in mb if it exists .