How to call an external program in python and retrieve the output and return code?

后端 未结 5 898
深忆病人
深忆病人 2020-11-27 15:42

How can I call an external program with a python script and retrieve the output and return code?

5条回答
  •  被撕碎了的回忆
    2020-11-27 16:22

    Check out the subprocess module here: http://docs.python.org/library/subprocess.html#module-subprocess. It should get what you need done.

提交回复
热议问题