1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-28 05:27:06 -05:00
dotfiles/lib/exec.py

18 lines
523 B
Python

import os
import pwd
def current_user():
return pwd.getpwuid(os.getuid()).pw_name
def sudo(cmd):
return subprocess.Popen(['sudo'] + cmd, shell=True,
stderr = subprocess.PIPE,
stdout = subprocess.PIPE,
stdin = subprocess.PIPE)
def exec(cmd):
return subprocess.Popen(['sudo'] + cmd, shell=True,
stderr = subprocess.PIPE,
stdout = subprocess.PIPE,
stdin = subprocess.PIPE)