1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-24 04:22:50 -05:00
dotfiles/lib/exec.py

18 lines
523 B
Python
Raw Normal View History

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)