【发布时间】:2018-01-30 06:20:06
【问题描述】:
模板来了,在while循环中,变量“index”是一个列表,所以,我无法理解代码“if index == 0”的意思,index[0] = “suc”, index [1]="失败"?请尽量说清楚。
import pexpect
while True:
index = child.expect(["suc","fail",pexpect.TIMEOUT])
if index == 0:
break
elif index == 1:
return False
elif index == 2:
pass #continue to wait
【问题讨论】:
标签: python-3.x expect pexpect