fin,fout = os.popen("ls -al") ListCmd = "ps -ef" fin,fout = os.popen4(ListCmd) etc
import os fin,fout = os.popen4("ls -al") print fout.read()