expect功能已超时。我张贴我的代码和手动完成时的步骤
import pexpect
from pexpect import popen_spawn
child = popen_spawn.PopenSpawn('tibemsadmin -server localhost:7222 -user admin -password admin', cwd='C:/tibco/ems/8.5 - Copy/bin')
out = child.sendline('delete queue zzzzzzz')
child.expect('Are you sure (yes,no)?')
print(out)
手动完成时:
C:\tibco\ems\8.5 - Copy\bin>tibemsadmin -server localhost:7222 -user admin -password admin
TIBCO Enterprise Message Service Administration Tool.
Copyright 2003-2019 by TIBCO Software Inc.
All rights reserved.
Version 8.5.1 V4 9/12/2019
Connected to: tcp://localhost:7222
Type 'help' for commands help, 'exit' to exit:
tcp://localhost:7222> delete queue zzzzzzz
Are you sure (yes,no)? yes
Queue 'zzzzzzz' has been deleted
tcp://localhost:7222>
错误:
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pexpect\expect.py", line 144, in timeout
raise exc
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x019AE790>
searcher: searcher_re:
0: re.compile(b'Are you sure (yes,no)?')
<pexpect.popen_spawn.PopenSpawn object at 0x019AE790>
searcher: searcher_re:
0: re.compile(b'Are you sure (yes,no)?')
目前没有回答
相关问题 更多 >
编程相关推荐