Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. from multiprocessing import Process
  2. import os,time
  3.  
  4. class P (Process):
  5. def __init__(self):
  6. super(P, self).__init__()
  7. def run(self):
  8. print (os.getpid())
  9. print('hello')
  10. time.sleep(10)
  11.  
  12. p = P()
  13. p.start()
  14. p.join(timeout=1)
  15.  
  16. if p.is_alive():
  17. p.terminate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement