1
2
3
4
5
6
7
8
9
10
11
12
13
14
# This connects to the openbsd ftp site and
# downloads the recursive directory listing.
import pexpect
child = pexpect.spawn ('ftp ftp.openbsd.org')
child.expect ('Name .*: ')
child.sendline ('anonymous')
child.expect ('Password:')
child.sendline ('noah@example.com')
child.expect ('ftp> ')
child.sendline ('cd pub')
child.expect('ftp> ')
child.sendline ('get ls-lR.gz')
child.expect('ftp> ')
child.sendline ('bye')
知识共享授权条款
本著作Chen, Zai-Chun制作,以知识共享 姓名标示-相同方式分享 4.0 国际 授权条款释出

留言

Jun 24 2010