def check_root_user():
 if (os.name == 'posix'):
  import pwd
  if (pwd.getpwuid(os.getuid())[0] == 'root'):
   sys.stderr.write("Running as user 'root' is a security risk.\n")

def check_root_user ( ) : if ( os . name == 'posix' ) : import pwd if ( pwd . getpwuid ( os . getuid ( ) ) [ 0 ] == 'root' ) : sys . stderr . write ( "Running as user 'root' is a security risk.\n" )
warn if the processs user is root .