Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check for root python

try:
    os.rename('/etc/foo', '/etc/bar')
except IOError as e:
    if (e[0] == errno.EPERM):
       sys.exit("You need root permissions to do this, laterz!")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #root #python
ADD COMMENT
Topic
Name
5+6 =