title: oct2py - Calling an octave function using threads in python
body: <p>I was trying to call an Octave function from a python program using two threads. My octave code is just to see how it works -</p>
  
  <p>testOctave.m</p>
  
  <pre><code>function y = testOctave(i)
      y = i;
  end
  </code></pre>
  
  <p>And the python program just tries to call it</p>
  
  <pre><code>from oct2py import octave
  import thread
  def func(threadName,i) :
      print "hello",threadName   // This printf works
      y = octave.testOctave(i)
      print y   // This is ignored
      print 'done'   // This is ignored
      print 'exiting'    // This is ignored
  
  try:
      thread.start_new_thread( func, ("Thread-1", 100 ) )
      thread.start_new_thread( func, ("Thread-2", 150 ) )
  except:
      print "Error: unable to start thread"
  </code></pre>
  
  <p>The program exits without giving any errors, but in the above function, the first print is only executed, all prints following the octave call are ignored by both threads. Is there a reason why this happens, and what can I do to make it work?</p>
  
  <p>The program doesnt do anything in particular, Im just trying to figure out how to work with oct2py</p>