def check_sudo():
"""
Checks for sudo/Administrator privileges
"""
check = None
if not subprocess.mswindows:
if getattr(os, "geteuid"):
check = os.geteuid() == 0
else:
import ctypes
check = ctypes.windll.shell32.IsUserAnAdmin()
return check
评论列表
文章目录