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 python3 -m pudo.disclaimer # or python2
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
Yes I Agree [Y/n]: y
Thank you for Accepting and using Pudo
Enjoy Automation !!!
Below is the code snippet for using in python automation for running commands under root privilege:
user$ python3 # or python2
>>> 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 Distribution
File details
Details for the file pudo-1.1.0.tar.gz
.
File metadata
- Download URL: pudo-1.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db8e423532bac17399635f02b7613c23cd47c87adb387c8d0f10ae70f97c1f15 |
|
MD5 | c343575f98bcccd365b0b86a03970cbb |
|
BLAKE2b-256 | 0d30cf2c3aa87d64ef84f7dd4c6d54c9191a17149b37fb801fa649d0288f9906 |