Everything you can do in the shell you can do using Python. The two key modules for doing so are: