그러므로 ctypes 를 이용해 프로세스 종료 함수를 만들어주어야 합니다.
import ctypes
KERNEL32 = ctypes.windll.kernel32
def RunProcess(cmd):
"프로세스 실행"
return sp.Popen(cmd)
def KillProcess(proc):
"프로세스 종료"
KERNEL32.TerminateProcess(int(proc._handle), -1)
proc = RunProcess("실행파일명 인자1 인자2")
raw_input()
KillProcess(proc)
참고:
http://code.activestate.com/recipes/347462/


python 을 좋아하는 게임 프로그래머