📅  最后修改于: 2022-03-11 14:46:55.587000             🧑  作者: Mango
import ctypes, os
def isAdmin():
""" Return True/Flase """
try:
is_admin = (os.getuid() == 0) # if Unis
except AttributeError:
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 # elese if Windows
return is_admin