programmatically executing and terminating a long-running batch process in python

后端 未结 3 2085
说谎
说谎 2021-01-06 03:04

I have been searching for a way to start and terminate a long-running \"batch jobs\" in python. Right now I\'m using \"os.system()\" to launch a long-running batch job insid

3条回答
  •  独厮守ぢ
    2021-01-06 03:27

    If you are on a Posix-compatible system (e.g., Linux or OS X) and no Python code has to be run after the child process, use os.execv. In general, avoid os.system and use the subprocess module instead.

提交回复
热议问题