pexpect.TIMEOUT 的默认值为 30 秒。在使用 pexpect 模块时,如果不传入 timeout 参数,则会使用默认值。

如果需要修改 timeout 值,可以在调用 pexpect.spawn 类的实例时传入 timeout 参数。例如:

child = pexpect.spawn('ls', timeout=10)

这将创建一个 pexpect.spawn 类的实例,timeout 值为 10 秒。

Python pexpect 模块 Timeout 参数详解

原文地址: http://www.cveoy.top/t/topic/ole8 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录