Python Script execute commands in Terminal

前端 未结 9 1685
余生分开走
余生分开走 2020-11-29 16:51

I read this somewhere a while ago but cant seem to find it. I am trying to find a command that will execute commands in the terminal and then output the result.

For

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 17:02

    The os.popen() is pretty simply to use, but it has been deprecated since Python 2.6. You should use the subprocess module instead.

    Read here: reading a os.popen(command) into a string

提交回复
热议问题