[Tutor] how to control putty window

David Rock david at graniteweb.com
Thu Dec 20 15:56:38 CET 2012


* Ufuk Eskici <ufukeskici at gmail.com> [2012-12-20 16:25]:
> Hello,
> 
> I run this command and opens putty:
> 
> import os
> import subprocess
> command = '"c:\Program Files\Putty\putty.exe" -ssh
> ufukeskici at 10.10.10.10-pw test
> subprocess.Popen(command)
> 
> But then I want to input new commands to this Putty new window. How can I
> do it?

Once you start putty, it is a separate application that python doesn't
really know anything about.  How many commands are you trying to send?
If it's only one or two, you might be able to set up a putty profile
with a couple auto-commands on connect, but that's not the same thing.
If it's a long string of commands, you might be better to pscp a shell
script to the target with one command, and then call that script with
the putty profile.

I would research automating putty first, then see if there are any
options within python to accomplish the same things.

-- 
David Rock
david at graniteweb.com


More information about the Tutor mailing list