Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from multiprocessing import Process
- import os,time
- class P (Process):
- def __init__(self):
- super(P, self).__init__()
- def run(self):
- print (os.getpid())
- print('hello')
- time.sleep(10)
- p = P()
- p.start()
- p.join(timeout=1)
- if p.is_alive():
- p.terminate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement