[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Interacting With Another Script

Chris Rebert

3/10/2010 4:40:00 PM

On Wed, Mar 10, 2010 at 8:34 AM, Victor Subervi <victorsubervi@gmail.com> wrote:
> On Wed, Mar 10, 2010 at 12:31 PM, Chris Rebert <clp2@rebertia.com> wrote:
>> Option C. The most user-friendly, and in some sense simplest, one.
>> Figure out the "conversation tree" vpopmail follows. Create a matching
>> form tree workflow, presenting multiple input fields at once. Run
>> vpopmail and write the appropriate input to its stdin based on the
>> form data. Send the output back as a webpage.
>
> Yeah, that was my idea. But how does the program know when it's being
> prompted to enter data? That's my question ;)

There's no magical "prompt time". The process's stdin's openness to
writing is not conditional.
Just send it all the input at once with the proper newlines in place
and it should work just fine assuming the user input was valid
(barring vpopmail using some fancy terminal input malarkey like
curses).

Cheers,
Chris
--
http://blog.re...
1 Answer

Dave \Crash\ Dummy

3/10/2010 4:44:00 PM

0

On 2010-03-10, Chris Rebert <clp2@rebertia.com> wrote:
> On Wed, Mar 10, 2010 at 8:34 AM, Victor Subervi <victorsubervi@gmail.com> wrote:
>
>> Yeah, that was my idea. But how does the program know when it's being
>> prompted to enter data? That's my question ;)
>
> There's no magical "prompt time".

That depends on the program. Some programs that prompt for input
(particulary username/password) flush stdin before displaying each
prompt. I'm not saying the program in question does that...

> The process's stdin's openness to writing is not conditional.

That doesn't mean that data written prior to the prompt won't be
ignore.

> Just send it all the input at once with the proper newlines in place
> and it should work just fine assuming the user input was valid
> (barring vpopmail using some fancy terminal input malarkey like
> curses).

It's worth trying, but there's a slight chance it won't work.

--
Grant Edwards grant.b.edwards Yow! But they went to MARS
at around 1953!!
gmail.com