Förvillelser
link

PBS is a unique subprocess wrapper that maps your system programs to Python functions dynamically. PBS helps you write shell scripts in Python by giving you the good features of Bash (easy command calling, easy piping) with all the power and flexibility of Python.

Ser väldigt smidigt ut.

import pbs
print pbs.ifconfig("eth0")

# resolves to "curl http://duckduckgo.com/ -o page.html --silent" pbs.curl("http://duckduckgo.com/", o="page.html", silent=True)

# print the number of folders and files in /etc print pbs.wc(pbs.ls("/etc", "-1"), "-l")

# sudo
with pbs.sudo: print pbs.ls("/root")

blog comments powered by Disqus