def if_user_in_group(group, member):
    members = win32net.NetLocalGroupGetMembers(None, group, 1)
return member.lower() in list(map(lambda d: d['name'].lower(), members[0]))
Determine if current user is in Administrators group (Windows/Python)