Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
check if the process is running as root (Unix/Linux)
import os
def got_root():
"""check if we are running as root."""
if os.geteuid() == 0:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.