def run_as_root(command, args, expand_path=True):
    run_as_root_path = find_executable('run-as-root-wrapper')
if not run_as_root_path:
    return 1
elif expand_path:
    command = os.path.realpath(command)
command = os.path.abspath(command)
command = os.path.normpath(command)
cmd = []
cmd.append(run_as_root_path)
cmd.append(command)
cmd.extend(args)
return subprocess.call(' '.join(cmd), shell=True)
Получить корневой диалог в Python на Mac OS X, Windows?