If you can do something interesting in bash, then here’s how you do it in python.
Suppose you have this interesting bash thing…
touch 'hello world'
find -xdev . -mmin -10 | grep hello
…and you want to do some crazy python thing on it. Here’s how you do it:
#! /usr/bin/python3
import os # the operating system
cmd=''' find -xdev . -mmin -10 | grep hello '''
for line in os.popen(cmd,'r'): # run the command, and read each line
print(line.strip()[1:13]) # do something interesting with it
And that’s the whole story: you don’t need to learn python: just write an ever-bigger shell script inside your python wrapper.