you don't have to call bash commands for what you are doing, reading a file?
use Python's own methods. this will ensure portability with your code
-
myfile="/home/myfile"
-
for lines in open(myfile): # equivalent of unix cat (or other tools for file reading)
-
print lines
-
if you want to use ls, use Python's os.listdir, glob.glob(), etc
if you want to cd, use os.chdir() etc
Look at the os module (as well as sys) for such things.