Skip to main content

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.

Below is the code snippit for using in python automation for running cmds 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 cmds under root privilege::

user$ pudo ls /root
Desktop  Downloads  Pictures  Music

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pudo, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size pudo-1.0.0-py3-none-any.whl (6.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pudo-1.0.0.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page