I am doing a project in Linux at system level in Python. So that, I want to know that if i am running my code as a normal user and if i am accessing system files then it sho
import os euid = os.geteuid() if euid != 0: raise EnvironmentError, "need to be root" exit()
This won't prompt in the middle of script but would rather force the user to re-run it with sudo or as root