Dear Andreas,

thank you very much for your reply. I re-checked, and indeed, I can force Python into interactive mode with the option -i. Using this option, Oz receives its output (see below). BTW: unfortunately, the Oz pipe can not distinguish between stdin and stderr, which would be very handy for cases like this.

Anyway, this did not solve my actual problem yet :-P Nevertheless, I would like to ensure whether a similar mechanism does apply for the programs I am interested in. So, does anybody knwo how applications like Python know the difference (ie. whether they are running in an interactive terminal or Oz' Open.pipe) and is there a way to fool them into believing otherwise (I tried setting the TERM environment variable to something different, but that didn't work).

Best
Torsten

%% The following examples works provides a Python interface to Oz ;-)
%% See previous mail for the definition of Shell.
declare
MyShell = {New Shell init(cmd:python args:["-i"])}
{MyShell showAll}

{MyShell cmd("1 + 2")}

{MyShell close}




On Sep 7, 2007, at 3:20 PM, [EMAIL PROTECTED] wrote:
Quoting Torsten Anders <[EMAIL PROTECTED]>:

I experience a problem with Open.pipe, which I do not understand. For most applications, I am able to read their stdout/stderr into Oz. For some applications, however, this output does not show up in Oz. There output works perfectly fine on the terminal though, including redirection of their output into files or pipes. What can be the reasons that some program outputting to stdout/stderr works perfectly fine on the commandline, but is quasi silent for Oz?

Probably this is not relevant, but some programs (e.g. some shells)
have different modes: interactive and non-interactive.
They can automatically detect whether they have an interactive
controlling terminal or not.  If they are run from Oz, such a
terminal is not present; that could explain that they behave
differently.
If this is the cause, the solution might be to look in the
documentation of the program for a way to "force" interactive
mode even when there is no terminal (shells usually have such
an option).

Good luck,
Andreas


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


______________________________________________________________________ ___________ mozart-users mailing list mozart- [EMAIL PROTECTED]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
http://strasheela.sourceforge.net
http://www.torsten-anders.de


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to