Python Script execute commands in Terminal

前端 未结 9 1701
余生分开走
余生分开走 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:06

    import os
    os.system("echo 'hello world'")
    

    This should work. I do not know how to print the output into the python Shell.

提交回复
热议问题