Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. #!/usr/bin/python3
  2. import os
  3.  
  4. def child():
  5.     print("HEY")
  6.  
  7. def parent():
  8.     while True:
  9.         print("Текущий pid:",os.getpid())
  10.         newpid = os.fork()
  11.         if newpid == 0:
  12.             child()
  13.         else:
  14.             print("Новый pid:",newpid)
  15.  
  16. parent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement