os.system("first_command < input_file | second_command > output_file")
print(os.popen("ls -l").read())
print subprocess.Popen("echo Hello", shell=True, stdout=subprocess.PIPE).stdout.read()
что аналогично:
print os.popen("echo Hello").read()
code = subprocess.call("echo Hello", shell=True)