title: How to run multiple functions with different return values in python
body: <p>I have multiple functions to train different classifiers, each function returns some related output parametes. The execution time of each is slightly long, so I want to take advantage of <code>multiprocessing</code>. </p>
  
  <p>For example:</p>
  
  <pre><code>test_mthd = 'complete'
  row_num = 288
  prob_scores_ANN = test_ANN(test_dataset,test_labels, test_mthd, row_num, 
                         input_hidden_weights, hidden_output_weights, 
                         input_hidden_bias, hidden_output_bias)
  predictions_KNN= eval_KNN(trainingSet,testSet, test_mthd, row_num)
  </code></pre>
  
  <p>Now, </p>
  
  <pre><code>from multiprocessing import Process
  if __name__=='__main__':
      p1 = Process(target=building_tree_CART(trainingSet, depth_cond=8, min_cond=1))
      p1.start()
      p2 = Process(target= train_ANN(training_data,training_labels))  
      p2.start()
      p1.join()
      p2.join()
  </code></pre>
  
  <p>Inspiration for this is from: <a href="https://stackoverflow.com/questions/18864859/python-executing-multiple-functions-simultaneously">LINK</a></p>
  
  <p>I think its a typo error: I changed <code>training</code> to <code>target</code>, and <code>p1</code> runs and then <code>p2</code> starts. and how do we return values from each function?</p>
  
  <p>Thanks,
  Gopi</p>