run-time pipeing

Matthew Dixon Cowles matt at mondoinfo.com
Fri Aug 17 16:56:15 EDT 2001


On Fri, 17 Aug 2001 13:11:55 +0200, Sven Herzberg <herzi at runbox.com>
wrote:

>I want to control a linux console client for filesharing via python
>and GTK+ via pipes (popen4). I had no problems with pipeing from an
>program wich finishes and quits like 'ls', but I can't read anything
>from a program that needs additional input (like ftp). It seems that
>my program waits for the console program to finish.

>Is it possible to create a 'pipeing' frontend to a program like ftp?

Dear Sven,
Yes, it is. But as you've found it's sometimes a big nuisance to get
the buffering right. I bet that you'll find one of the Expect-like
modules available at The Vaults of Parnassus to be useful. (Expect is
a tool written under Tcl that is often used to automate interactive
programs like ftp.) Those modules generally deal with the buffering
and do a few other helpful things besides. I'd go over to:

http://www.vex.net/parnassus/

and do a search for "expect". I bet that one or another of those
modules will make things easier for you.

Regards,
Matt



More information about the Python-list mailing list