python 脚本实现ftp--expect

#!/usr/bin/env python
import 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')


你可能感兴趣的:(python,File)