Hacker News new | ask | show | jobs
by argonauts12 2167 days ago
I've been migrating shell scripts to python and have found the 'sh' library invaluable for pulling in pure CLI commands from the bash script and adding to the python implementation. http://amoffat.github.io/sh/ It's essentially an abstraction layer above subprocess. Quick example - to use ifconfig natively in python:

from sh import ifconfig print(ifconfig("wlan0"))