Use os.popen with read to get the output of the command import os print os.popen("echo Hello World").read()