python - checking if a user has admin privileges
- by Matt
Hi, I'm writing a little program as a self-learning project in Python 3.x. my idea is for the program to allow two fields of text entry to the user, and then plug the user's input into the value of two specific registry keys.
What I was wondering, and something my books don't seem to cover, is if there is a simple way to make it check if the current user can access the registry. I'd rather it cleanly tell the user that he needs admin privileges than for the program to go nuts and crash because it's trying to access a restricted area.
I'd like it to make this check as soon as the program launches, before the user is given any input options. What code is needed for this?
thanks for the help