popen and password entry

sinan nalkaya erchamion.beren at gmail.com
Wed Jun 14 11:14:42 CEST 2006


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 root at 10.1.1.1:/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 popen2
st_out, st_in = popen2.popen2(cmd)
st_in.write('1234')
#not worked
st_in.write('1234\n')
#not worked again
i got bored to see "Password:" line every time and did st_out.close() to not 
to see stdout messages from rsync, but even this did not work.
also i tried popen3() function same way.
what should i do?
Thanks.



More information about the Python-list mailing list