📜  python check is admin - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:05.792000             🧑  作者: Mango

代码示例1
import ctypes, os
    
def isAdmin()
      try:
         is_admin = os.getuid() == 0
    except AttributeError:
         is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
    return is_admin