Python: Start new command prompt on Windows and wait for it finish/exit

前端 未结 5 1283
夕颜
夕颜 2020-11-28 11:23

I don\'t understand why it\'s so hard to do this on Windows.

I want to spawn a bunch of command prompt windows which will run other scripts. The reason I want this i

5条回答
  •  感动是毒
    2020-11-28 11:43

    For me this seems to work
    os.system("cmd /k {command}")

    With /k cmd executes and then remain open
    With /c executes and close

    To open a new command window and then execute the command
    os.system("start cmd /k {command}")

提交回复
热议问题