views:

296

answers:

1

I want certain functions in my application to only be accessible if the current user is an administrator.

How can I determine if the current user is in the local Administrators group using Python on Windows?

+5  A: 

You could try this:

import ctypes
print ctypes.windll.shell32.IsUserAnAdmin()
ChristopheD
This should work fine, thanks!
FogleBird
works very fine.
Ahmet Alp Balkan