Interacting With Another Script

Chris Rebert clp2 at rebertia.com
Wed Mar 10 11:39:57 EST 2010


On Wed, Mar 10, 2010 at 8:34 AM, Victor Subervi <victorsubervi at gmail.com> wrote:
> On Wed, Mar 10, 2010 at 12:31 PM, Chris Rebert <clp2 at 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.rebertia.com



More information about the Python-list mailing list