32324 发表于 2014-5-8 09:37:41

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')

页: [1]
查看完整版本: python 脚本实现ftp--expect