Created
March 10, 2018 12:23
-
-
Save paulwinex/1e6113d5536bedd44c91eb9c0ea6a3c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, ctypes | |
def is_admin(): | |
if os.name == 'nt': | |
return ctypes.windll.shell32.IsUserAnAdmin() != 0 | |
else: | |
return os.geteuid() == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment