[Tutor] how to control putty window

Ufuk Eskici ufukeskici at gmail.com
Fri Dec 21 15:44:39 CET 2012


Hello,

I changed my way. This time I'm using "plink" under Putty.

My python code is:

os.chdir("c:\\Program Files\\Putty")
cmd = "plink -ssh -l ufuk10.10.10.10 -pw password"
process = subprocess.Popen(cmd)
inputdata="r van"
result = process.communicate(inputdata)

But after the successful SSH, I cannot continue, no command runs:
This is the new output after the initial SSH connection:
No data input.

Last login: Fri Dec 21 16:27:
ufuk at home-ubuntu:~$


2012/12/20 Prasad, Ramit <ramit.prasad at jpmorgan.com>

> Ufuk Eskici wrote:
> > 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?
> >
>
> Do you need to control Putty or just SSH to another computer?
> If all you need to SSH then I would recommend using a 3rd
> party module such as Fabric (which relies on Paramiko). Those modules
> will simply SSH significantly. They are Python 2.x but you should
> be able to use Paramiko in 3.x except for SFTP. This link might help
> to install Paramiko if you are using Python 3.
> https://github.com/paramiko/paramiko/issues/16
>
> If you need to control Putty specifically then I cannot help.
>
>
> Ramit
>
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121221/0c4fc7a4/attachment.html>


More information about the Tutor mailing list