多处理机中的封闭程序

2024-06-23 02:45:21 发布

您现在位置:Python中文网/ 问答频道 /正文

在使用现有进程的多重处理时,如何关闭程序?你知道吗

import easygui
import multiprocessing

def func():
    reply=easygui.buttonbox("start?",image="F:\project\phonber.png",choices=['yes','no'])
    if reply=="yes":
        exit_option()


if __name__=='__main__':
    p=multiprocessing.Process(target=func,args=())
    t=p.start()
    print "1"
    while True:
        None

我要exit_option()关闭程序。你知道吗


Tags: imageimportif进程defexitreplymultiprocessing