title: Python process to complete before downstream commands run
body: <p>I have 2 process running and I want them to complete before further down command executes (at the end of script it prints out that the program has ended). How can I make sure the process completes before printing out that it has ended?</p>
  
  <pre><code>from multiprocessing import Process
  import datetime
  
  class foo:
      def fun1():
          do sthn
  
      def fun2():
          do sthn
  
  ob = foo()
  
  if __name__ == '__main__':
  
      p1 = Process(target = ob.fun1)
      p1.start()
      p2 = Process(target = ob.fun2)
      p2.start()
  
  endTime=datetime.datetime.now()
  print 'Program Ending time is: ', endTime
  </code></pre>