To run a program like apt, you must be using `reactor.spawnProcess´. ThatOn Sat, 16 Aug 2008 14:04:22 +0200, The Noob <firstname.lastname@example.org> wrote:
I try to implement a custom ssh server with twisted . I use* sshserver.py to
begin (* http://www.devshed.com/c/a/Python/SSH-with-Twisted/ )
I would like to execute interactive scripts which are on my server. The
problem is theses scripts are interactives. How can I redirect IO on my
For example, if I want to install a software with apt. I have questions to
install dependencies ( yes/no)
I start to create a definition for this function like def do_apt. And then
when in my custom shell I execute ( apt python)., that executes apt-get
install python on the server. But how can I redirect the output in my shell
to answer dependencies questions ?
Thanks for your help
means that you have two different protocol implementations. One to talk
to the SSH connection (eg, `SSHDemoProtocol´ in the O'Reilly example) and
one to talk to the child process.
If you want output from the child process to show up in the SSH client, then
when the process protocol receives data from it, it should pass it on to the
SSH protocol to write to the client. Similarly, if you want input from the
SSH client written to the stdin of the child process, when the SSH protocol
receives data it should pass it on to the process protocol to write to the
You'll have to keep track of what state your application is in to do this
correctly. Input should only be handled this way when there is actually
a child process running.
Twisted-Python mailing list