본문 바로가기
python/threading

Thread 내에서 프로세스 종료하기

by Falto 2021. 4. 18.
from threading import Thread
import time
import os

def f():
    pid = os.getpid()
    os.kill(pid, 2)

Thread(target=f).start()

time.sleep(9)

 

'python > threading' 카테고리의 다른 글

실행 순서 구분  (0) 2021.04.18

댓글