help-octave
[Top][All Lists]
Advanced

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

Re: Windows; Invoking Octave


From: Shai Ayal
Subject: Re: Windows; Invoking Octave
Date: Sat, 24 Jun 2006 21:52:54 +0300
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

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 octave.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 (octave.sh) 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 octave.sh 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 octave.sh
(you have to find out the path of sh.exe -- the above path is a wild guess)

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

Shai


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 octave.sh 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 octave.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\subprocess.py", 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
https://www.cae.wisc.edu/mailman/listinfo/help-octave




reply via email to

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