def make_executable ( script_path ) : status = os . stat ( script_path ) os . chmod ( script_path , status . st_mode | stat . S_IEXEC )
create executable python script directly instead of chmod
Make script_path executable .
def make_executable(script_path):
    """Make `script_path` executable.

    :param script_path: The file to change
    """
    status = os.stat(script_path)
    os.chmod(script_path, status.st_mode | stat.S_IEXEC)