def chmod_plus_x(path):
 path_mode = os.stat(path).st_mode
 path_mode &= int(u'777', 8)
 if (path_mode & stat.S_IRUSR):
  path_mode |= stat.S_IXUSR
 if (path_mode & stat.S_IRGRP):
  path_mode |= stat.S_IXGRP
 if (path_mode & stat.S_IROTH):
  path_mode |= stat.S_IXOTH
 os.chmod(path, path_mode)

def chmod_plus_x ( path ) : path_mode = os . stat ( path ) . st_mode path_mode &= int ( u'777' , 8 ) if ( path_mode & stat . S_IRUSR ) : path_mode |= stat . S_IXUSR if ( path_mode & stat . S_IRGRP ) : path_mode |= stat . S_IXGRP if ( path_mode & stat . S_IROTH ) : path_mode |= stat . S_IXOTH os . chmod ( path , path_mode )
equivalent of unix chmod a+x path .