def _chown(path, uid, gid):
 os.chown(path, uid, gid)
 for item in os.listdir(path):
  item_path = os.path.join(path, item)
  if os.path.isfile(item_path):
   os.chown(item_path, uid, gid)
  elif os.path.isdir(item_path):
   os.chown(item_path, uid, gid)
   _chown(item_path, uid, gid)

def _chown ( path , uid , gid ) : os . chown ( path , uid , gid ) for item in os . listdir ( path ) : item_path = os . path . join ( path , item ) if os . path . isfile ( item_path ) : os . chown ( item_path , uid , gid ) elif os . path . isdir ( item_path ) : os . chown ( item_path , uid , gid ) _chown ( item_path , uid , gid )
change permissions recursively .