mirror of
https://github.com/Foltik/dotfiles
synced 2024-11-24 12:26:05 -05:00
18 lines
523 B
Python
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)
|