python and ssh, scp on windows

Jaco Smuts JSmuts at
Tue Aug 31 08:52:01 CEST 2004

Hello there

The short version
question: I am looking for information, resources sample code on using ssh 
and scp from a python program that will run on windows.

The longer version:
problem: My brother needs to update his website (hosted on a linux box) 
using scp. He currently uses putty, pscp (on win 2k). The problem comes in 
that the site is very large. Invariably his dial-up connection would 
disconnect before all the files has been uploaded. Unfortunately to our 
knowledge pscp does not have a resume mechanism when only some of the 
files has been uploaded.

I thought I'd address this by creating a data structure resembling his 
site structure and files (to be pickled for persistence), this would give 
me the ability to 
- keep record of when a file has last  been uploaded. Compare this to when 
the file has last been updated and upload only upload updated files
- "restart" the upload should the connection fail before all files has 
been uploaded.

I am considering simply calling pscp (putty secure copy) using popen2, or 
something to that vain. Are there any better ways. (This is intended to be 
a fairly simple script not a week project)

I have looked at paramiko, but it uses termios, which would limit me to 
Unix's (just realised uses termios, so I might be wrong here.)

I've also looked at pyssh, but it's been stuck for a very long time at 
version 0.2, does not support wrapping scp anymore and seems to have 
issues on windows.

I suspect that twisted might provide me with a solution, but I don't 
really know twisted and this just seems like a bit of an overkill? If that 
is the way to go I am not closed to this thought, was just hoping for 
something a bit simpler

Any  idea's, code, suggestions would greatly be appreciated


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list