Python version of linux sudo command without password prompt
Project description
Pudo Package
This is an Python Package for running Linux commands with root permission. We can see this as an alternative to Linux sudo command without password prompt. This is very handy when you are writing python automation scripts and need to deal with root privileges. You can use this as an python module or an Linux command.
Before using the pudo, please accept the Disclaimer:
user$ sudo /usr/local/bin/pudo --accept-disclamer
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
PLEASE NOTE:
Pudo Developers are not responsible for any misuse of Root Privileges
Thank You for Accepting the Disclaimer:
It is great quality of you to respect other's privacy
Below is the code snippet for using in python automation for running commands under root privilege:
user$ python3 # or python2
>>> from pudo import pudo
>>> (ret, out) = pudo.run(('ls', '/root')) # or pudo.run('ls /root')
>>> print(ret)
0
>>> print(out)
b'Desktop\nDownloads\nPictures\nMusic\n'
Below is the cmd example for running commands under root privilege:
user$ pudo ls /root
Desktop Downloads Pictures Music
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file pudo-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: pudo-1.4.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f745f3dac99599a73d6cd67da37d5b572b74b38aa0ff802223f1442d148d76a5 |
|
MD5 | 99ab7e109dd168110b66169a7dddf6f0 |
|
BLAKE2b-256 | 729fffed45d187278976310f9d4d186f946fe863c8695ee55df1f2033cad02ca |