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.
Is there 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/she needs administrator 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?
Edit: in case it isn't obvious, this is for the Windows platforms.