elevate_admin.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Wall-EEG 作者: neurotechuoft 项目源码 文件源码
def isUserAdmin():

    if os.name == 'nt':
        import ctypes
        # WARNING: requires Windows XP SP2 or higher!
        try:
            return ctypes.windll.shell32.IsUserAnAdmin()
        except:
            traceback.print_exc()
            print("Admin check failed, assuming not an admin.")
            return False
    elif os.name == 'posix':
        # Check for root on Posix
        return os.getuid() == 0
    else:
        raise(RuntimeError, "Unsupported operating system for this module: %s" % (os.name,))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号