Hi Avner .H.,
I can't help you with your first problem, other than to say "why not put the Bash code in a Bash script?" which I guess is not an option for you, or else you would have done it.
However, I can help with the second item: grabbing STDOUT from the execution of external commands. Rather than use os.system(), use os.popen(), like so:
import os
stdout_handle = os.popen("echo something", "r")
text = stdout_handle.read()
At this point, the variable 'text' will contain any data that `echo something` sent to STDOUT (namely, the string "something"). Not sure how this works with STDERR, though - you'll have to do some digging to figure that out.
Hope that helps!
EDIT: also, with respect, why not just write the whole thing in Python? Or in Bash, if the project is simple enough?
In my limited experience, Frankenscripts are great as quick and dirty solutions to one-time problems, but for a larger project or a re-occurring problem it's better to stick to one programming paradigm. And truly, I don't know that it's worth learning how to do these kinds of programmatic gymnastics when the whole thing can likely be written in Python.
Just my $0.02, anyway.