In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >Your best bet would be to use "pexpect" module. Code may look something >like: > >import pexpect >import sys >child = pexpect.spawn ('ftp ftp.site.com') >child.expect ('Name .*: ') >child.sendline ('username') >child.expect ('Password:') >child.sendline ('password') >child.expect ('ftp> ') >child.sendline ('cd testdir') >child.expect ('ftp> ') >child.sendline ('bin') >child.expect ('ftp> ') >child.sendline ('hash') >child.expect ('ftp> ') >child.sendline ('get testfile') >child.expect ('ftp> ') >print child.before >child.sendline ('bye') > >Raghu. >~ >
... and, for those for whome pexpect is somehow infeasible, there are a variety of ways to work around its absence <URL: http://phaseit.net/claird/comp.unix.programmer/ftp_automation.html >. -- http://mail.python.org/mailman/listinfo/python-list