How to use octave in python

Robert Kern rkern at
Thu Jul 21 03:06:43 CEST 2005

b83503104 at wrote:
> Hi,
> I want to use octave to read a file and do some matrix operation.  My
> question is, how do I do it inside my python script?  Also, can I write
> octave line by line in python without having to write the octave code
> in another script and then  call it in the python script?

You could try communicating with an octave instance using the subprocess 
module in the standard library. Depending on what that matrix operation 
is, though, you might want to consider doing it all in Python using 
Numeric and possibly Scipy.

Robert Kern
rkern at

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

More information about the Python-list mailing list