> sinan nalkaya <[EMAIL PROTECTED]> writes:
> child.expect(['Password:','Password: ',pexpect.EOF,pexpect.TIMEOUT])
> if i == 0: child.sendline(passwd)
> elif i == 1:print 1
> elif i == 2:print 2
> elif i == 3:prin
finally following code works,
import pexpect, sys
cmd = '/usr/bin/rsync config [EMAIL PROTECTED]:/tmp/.'
#cmd = 'ssh [EMAIL PROTECTED]'
child = pexpect.spawn(cmd)
child.logfile = sys.stdout
passwd = 'qwe123'
i = 0
try:
while i == 0:
i =
child.expect(['Password:','Password:
i put while True: before top of line, i=child.expect() . it worked, the file
has gone but also it goes into loop with many EOF result, i tried the
os.waitpid() function with child.pid but didnt help me. still couldn`t get
the problem.
thanks for help
On Thursday 15 June 2006 12:04, Ganesan Raj
> sinan nalkaya <[EMAIL PROTECTED]> writes:
> thanks for reply, i add the line you suggested, thats what i get
> [EMAIL PROTECTED]:~/tmp/multi_server$ python deneme.py
> Password: qwe123
> finished
Ah, got it. You didn't wait for the rsync process to complete. Put the body
of the "try:" in a
thanks for reply, i add the line you suggested, thats what i get
[EMAIL PROTECTED]:~/tmp/multi_server$ python deneme.py
Password: qwe123
finished
Exception pexpect.ExceptionPexpect: in > ignored
does rsync may cause a problem while trying to fork-exec ssh ?
> Add "child.logfile = sys.stdout" he
> Sinan Nalkaya <[EMAIL PROTECTED]> writes:
> hi,
> i have found expect method for this purpose. i`m trying to use pexpect but
> following code gives me an something strange as a result.
When working with pexpect, logging the entire conversation is extremely
useful fro debugging
> import pex
hi,i have found expect method for this purpose. i`m trying to use pexpect but following code gives me an something strange as a result.# The CODEimport pexpectcmd = '/usr/bin/rsync config [EMAIL PROTECTED]:/tmp/.'
#cmd = 'ssh [EMAIL PROTECTED]'child = pexpect.spawn(cmd)passwd = 'qwe123'try:
hello,
i want to use rsync for remote file transfer via popen, but couldnt pass the
Password yet.
here`s what i did
cmd = 'rsync -av config [EMAIL PROTECTED]:/tmp/.'
f = os.popen(cmd,'w')
f.write('1234')
#not worked
f.write('1234\n')
#not worked
every time i see "Password:" line, then i tried p
> sinan nalkaya <[EMAIL PROTECTED]> writes:
> i want to use rsync for remote file transfer via popen, but couldnt pass
> the Password yet.
For interactive input try the pexpect module instead of popen (see
http://pexpect.sf.net).
Ganesan
--
Ganesan Rajagopal
--
http://mail.python.org/ma
hello,
i want to use rsync for remote file transfer via popen, but couldnt pass the
Password yet.
here`s what i did
cmd = 'rsync -av config [EMAIL PROTECTED]:/tmp/.'
f = os.popen(cmd,'w')
f.write('1234')
#not worked
f.write('1234\n')
#not worked
every time i see "Password:" line, then i tried p
10 matches
Mail list logo