On Thu, 2 Jan 2003 16:14:50 -0200
Christian Reis <[EMAIL PROTECTED]> wrote:

> > > On Thu, Jan 02, 2003 at 08:50:39AM +0100, Martijn Brouwer wrote:
> > I would like to be able to communicate in two ways with an interactive program:
> 
> What does `interactive program' mean? A program that uses a terminal to
> input data (like Autocad's command-line prompt?)

I don't know about autocad, the program I mean is octave (www.octave.org). I is an 
matlab like interpreter for numerical calculations. Just like the python interpreter 
it can interpret command from a shell.  The user types a command, which is processed 
by the interpreter. After processing, and possibly output of the result, a prompt is 
presented and the user can enter a new command.
 
> > 1) by the user. This should be visible in a terminal.
> 
> So what the user types shows up in the terminal, as expected?

Yes.


> > 2) by the graphical frontend application. This should be hidden from
> > the user.  I could use a zvt terminal, fork the interactive program
> > and let the user communicate with the interactive program. In this
> > case communication type 1) is trivial. But as far as I know, type 2
> > communication is not possible in this case, since all input to and
> > from the interactive program has to go through the zvt terminal.  When
> 
> You could communicates using pipes, even using input_add(), no? Johan
> has fixed up a version of the original pygtk test script that he calls
> `console.py' that does IPC with Python, maybe he'd be nice enough to
> share it with you.

My first ideas were about communicating with pipes. After some reading I decided to 
look for something else, since I need two-way communication. When pipes are used, 
'deadlocks' may occur: situations where both programs are waiting for input from the 
other site. 
 
> Apart from that I must admit I still don't know what you mean. Maybe an
> example with more concrete information "App X does this, has window,
> etc"..

I want to make a graphical shell for octave, which allows the user to use it as if he 
was using it in its normal environment. Additionally I want my application to be able 
to communicate with octave without the user noticing. This is necessary for adding 
additional functionality over just a simple graphical shell.

Hope I finally managed to make clear what I intend.

Bye,

Martijn
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to