Better HN
topnewbestaskshowjobs
Log inSign up

argonauts12

1 karma · joined Dec 22, 2016 (9y ago) · 1 submissions

Submissions

comment 6y ago · link · parent

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"))