【发布时间】:2013-02-23 15:17:47
【问题描述】:
我们简单的 pexpect 脚本是这样的:
import pexpect
import sys
test = pexpect.spawn('ftp www.today.com')
test.logfile = sys.stdout
test.expect('Name.*')
但是,在调用脚本的 shell 上,没有显示输出。 相反,它似乎挂起,但我们可以看到进程 ftp ... 已生成。
如何在调用脚本的 shell 上显示输出?
谢谢
【问题讨论】: