[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Windows; Invoking Octave

From: Reidar Strand Hagen
Subject: Re: Re: Windows; Invoking Octave
Date: Thu, 29 Jun 2006 15:57:51 +0200

Just wanted to say thanks. I'm less confused now.
C:\Program Files\GNU Octave 2.1.73>echo rand(10) | bin\sh
[lots of output] did not pass arguments, so changing to 'octave.exe $@' made it behave more sanely (from my perspective atleast). I'll file a bug report as soon as SF stops not working.

On 24/06/06, Shai Ayal <address@hidden > wrote:
I do not know the octave-forge 2.1.73 package you use, but my guess is
that the command line you use:
c:\program files\GNU octave2.1.73\bin\run.exe rxvt.exe -e /bin/sh
Is taken from the shortcut that activates octave.

What it does is activate a terminal application (rxvt) that runs a shell
(/bin/sh) that runs a script ( that probably sets up all the
necessary stuff to run octave.
The fact that your first example does not works seems to imply that the
script does not pass its arguments to octave
Your second example does not work since the terminal application (rxvt)
does not read from standard input.

I would suggest -- As a quick and dirty fix, try running using pipes,
but with the command line w/o rxvt:
c:\program files\GNU octave2.1.73\bin\sh.exe
(you have to find out the path of sh.exe -- the above path is a wild guess)

Another fix is to look at and make it pass command line
arguments to the underlying octave process.


Reidar Strand Hagen wrote:
> Hi
> I'm using Octave on windows, and am trying to communicate with it from
> Python.. whether accomplished through pipes, or simply providing a
> script for octave to run is of no importance, although I would like to
> somehow catch stdout in case of error-messages.. and certainly don't
> want to have the GUI flash up for simply running a script.
> Previously, I did this with an older Octave version without support
> for Nd-arrays etc without problems. I don't remember which version
> (nor where I found it, but it had an installer and didn't need
> seperate install of cygwin, and was installed to ~\GNU Octave without
> versionnumbering),  However, after switching to octave-2.1.73-0 from
> Octave-forge can't seem to communicate with Octave in any way except
> manually through the GUI: The way Octave-forge is wrapped into cygwin
> is confusing the **** out of me, so I was wondering if anybody had any
> tips?
> regards
> Reidar Strand Hagen
> ------
> Attempting to run a script manually:
> C:\Program Files\GNU Octave 2.1.73>type smallscript.txt
> save abcdabcd
> quit()
> C:\Program Files\GNU Octave 2.1.73>"C:\Program Files\GNU Octave
> 2.1.73\bin\run.exe " rxvt.exe -e smallscript.txt
> C:\Program Files\GNU Octave 2.1.73>dir abcdabcd
>  Volume in drive C has no label.
>  Volume Serial Number is 31FA-E7F7
>  Directory of C:\Program Files\GNU Octave 2.1.73
> File Not Found
> -------
> Attempting to run communicate through pipes:
> Python 2.4.3 - Enthought Edition 1.0.0 (#69, Apr 18 2006, 15:43:47)
> [MSC v.1310 32 bit (Intel)] on win32
> IDLE 1.1.3
>>>> import subprocess
>>>> p = subprocess.Popen(r"c:\program files\GNU octave
> 2.1.73\bin\run.exe rxvt.exe -e /bin/sh ",shell=False, stdin=
> subprocess.PIPE, stdout= subprocess.PIPE, stderr= subprocess.STDOUT)
>>>> in_,out_ = p.communicate("a=5")
> Traceback (most recent call last):
>   File "<pyshell#2>", line 1, in -toplevel-
>     in_,out_ = p.communicate("a=5")
>   File "C:\Python24\lib\", line 783, in communicate
>     self.stdin.write (input)
> IOError: [Errno 22] Invalid argument
> Running as a script instead of interactive will make communicate just
> return ("",None).
> _______________________________________________
> Help-octave mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]