K
Size: a a a
K
t
t
t
K
t
t
K
K
K
K
class SubprocessTask(threading.Thread):
process = None
def __init__(self):
superчототам
self._stop_event = threading.Event()
def run(self):
for task in blablabla:
self.process = subprocess.Popen(...)
self.process.communicate()
if self._stop_event.is_set()
return
def stop_task(self):
self._stop_event.set()
if self.process is not None:
self.process.kill()
self.process = NoneFO
K
K
Dv
Dv
K
K
K
K