The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

Views: 96     Votes:  4 
Tags: python   sudo  
Link: 🔍 See Original Answer on Stack Overflow 🔗

URL: https://stackoverflow.com/q/60292202
Title: Ensure python script isn't run as root
ID: /2020/02/19/Ensure-python-script-isn_t-run-as-root
Created: February 19, 2020
Upload: November 24, 2022    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


Put this into your Python program/script:

#import os

if os.geteuid() == 0:
    exit("You cannot call 'mmm' using using 'sudo' powers. Exiting.")

Of course you would replace mmm with your own python filename.

⇧ Cancel buttons Zenity How to switch back to default booting process?  ⇩