title: Python checking if a fork() process is finished
body: <p>Just wondering if some one could help me out. The problem I'm having is that I os.fork() to get several bits of information and send them to a file, but checking to see if the fork process is not working.</p>
  
  <pre><code>import sys
  import time
  import os
  import re
  
  
  ADDRESS  = argv[1]
  sendBytes = argv[2]
  
  
  proID2 = os.fork()
  if proID2 == 0:
      os.system('ping -c 20 ' + ADDRESS + ' &gt; testStuff2.txt')
      os._exit(0)
  
  print proID2
  
  finn = True
  while finn == True:
  time.sleep(1)
  finn = os.path.exists("/proc/" + str(proID2))
  print os.path.exists("/proc/" + str(proID2))
  print 'eeup out of it ' + str(proID2)
  </code></pre>
  
  <p>I think that the os.path.exists() is maybe not the right thing to use.</p>
  
  <p>Thanks.</p>