Advertisement
Guest User

Untitled

a guest
Apr 10th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from multiprocessing import Process
  2.  
  3. def checking(process):
  4.     #codes here
  5.     #return 1 if the process is still running, 0 if the process isn't
  6. def a():
  7.     while 1: pass
  8. process = Process(target=a)
  9. process.start()
  10. checking(process) #return 1
  11. process.terminate()
  12. checking(process) #return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement