python 脚本实现ftp--expect
#!/usr/bin/env pythonimport pexpect
child = pexpect.spawn ('ftp *.*.*.*')
child.expect ('Name .*: ')
child.sendline ('user')
child.expect ('Password:')
child.sendline ('****')
child.expect ('ftp> ')
child.sendline ('cd .')
child.expect('ftp> ')
child.sendline ('get file')
child.expect('ftp> ')
child.sendline ('bye')
页:
[1]