Re: Problem with PEXPECT in Python

2008-06-05 Thread A.T.Hofkamp
On 2008-06-04, Mallikarjun Melagiri <[EMAIL PROTECTED]> wrote: > Hi Noah, > > I am new to python. I'm trying to use pexpect. > > Following is my problem definition: > > I should have a script on my machine A, which > should 'ssh' to machine B and from there i

Problem with PEXPECT in Python

2008-06-04 Thread Mallikarjun Melagiri
Hi Noah, I am new to python. I'm trying to use pexpect. Following is my problem definition: I should have a script on my machine A, which should 'ssh' to machine B and from there it shud copy a file to machine C thru 'scp'. Please help me. Regards M

Re: Problem with PEXPECT in Python

2007-10-23 Thread Laszlo Nagy
> > > > > cmd ='scp'+' '+source_file+' '+user+'@'+ip+':'+desti_path > You might wanna try to login with a public/private key pair, then scp won't ask for a password. -- http://mail.python.org/mailman/listinfo/python-list

Problem with PEXPECT in Python

2007-10-23 Thread jai simhan
import sys,os import pexpect source_file= 'sourcefile.txt' user='username' ip='00.00.00.00' desti_path='/home/jai/………' password='bond007' cmd ='scp'+' '+source_file+' '+user+'@'+ip+':'+desti_path try: foo = pexpect.spawn(cmd) foo.expect('.ssword:*'

Re: Problem with PEXPECT in Python

2007-07-02 Thread Noah
Kevin Erickson wrote: > On Jun 30, 5:50 pm, Kevin Erickson <[EMAIL PROTECTED]> wrote: > > #Begin Code > > > > import sys > > import pexpect > > > > def GetServerData(self): > > foo = pexpect.spawn('scp [EMAIL PROTECTED]:/home/config/ > > role{/file1,/files/file2,/files/file3} /tmp') >

Re: Problem with PEXPECT in Python

2007-06-30 Thread Kevin Erickson
On Jun 30, 5:50 pm, Kevin Erickson <[EMAIL PROTECTED]> wrote: > Hello, > > I am attempting to use pexpect in python to copy files from a server > using scp; the copy works however exceptions are thrown and it exits > unsuccessfully. Below is the a sample code and the error: > > #Begin Code > > im

Problem with PEXPECT in Python

2007-06-30 Thread Kevin Erickson
Hello, I am attempting to use pexpect in python to copy files from a server using scp; the copy works however exceptions are thrown and it exits unsuccessfully. Below is the a sample code and the error: #Begin Code import sys import pexpect def GetServerData(self): foo = pexpect.sp