0

How can I close a program while i use multiprocessing from an existing process?

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

I want that the exit_option() will shutdown the program.

GIZ
  • 4,409
  • 1
  • 24
  • 43
user4719989
  • 107
  • 1
  • 4
  • 11

1 Answers1

0

In sys module there is a function called exit

Maurice Meyer
  • 17,279
  • 4
  • 30
  • 47