Killing a script launched in a Process via os.system()

前端 未结 4 689
旧时难觅i
旧时难觅i 2021-01-13 02:35

I have a python script which launches several processes. Each process basically just calls a shell script:

from multiprocessing import Process
import os
imp         


        
4条回答
  •  甜味超标
    2021-01-13 03:07

    In Python 3.3, the subprocess module supports a timeout: http://docs.python.org/dev/library/subprocess.html

    For other solutions regarding Python 2.x, please have a look in this thread: Using module 'subprocess' with timeout

提交回复
热议问题