import os "running the command" os.system(command) "capturing the output" result = os.popen(command).read()