I have write this program:
[mik@mikypc ~]$ cat ftp.py
#!/usr/bin/env python
# This connects to the rediris ftp site
#
import pexpect
child = pexpect.spawn('ftp ftp.rediris.es')
child.expect('Name .*: ')
child.sendline('anonymous')
child.expect('ftp> ')
child.sendline('[email protected]')
child.expect('ftp> ')
child.sendline('lcd /tmp')
child.expect('ftp> ')
child.sendline('pwd')
child.expect('ftp> ')
child.sendline('bye')
[mik@mikypc ~]$ ./ftp.py
[mik@mikypc ~]$
[mik@mikypc ~]$
[mik@mikypc ~]$
But I cannot see the output. How could I see it?. I don't see anything when I execute it. How could I see the output?.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…