📌  相关文章
📜  python 以管理员身份运行 - Python 代码示例

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

代码示例1
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