在写一个多进程中,需要在一个进程结束后,结束整个脚本,所以特别找了下这个方面的代码。
import os pid=os.getpid() cmd='kill -9 '+str(pid) os.system(cmd)