A bit off-topic, but still could apply for future python work… Feel free to separate into another topic.
I have starting using a python library named
sh and thought I would share. It allows very easy access to shell commands without needing to use subprocess, etc. I figure since Whonix is largely shell script based it may come in handy.
Here are a few examples of usage (from the docs):
from sh import ifconfig print(ifconfig("wlan0")) # checkout master branch git.checkout("master") # print(the contents of this directory print(ls("-l")) # get the longest line of this file longest_line = wc(__file__, "-L")
Note that these aren’t Python functions, these are running the binary commands on your system dynamically by resolving your $PATH, much like Bash does. In this way, all the programs on your system are easily available to you from within Python.