mirror of
https://github.com/clearml/wexpect-venv
synced 2025-01-31 10:57:07 +00:00
20 lines
270 B
Python
20 lines
270 B
Python
import wexpect.host
|
|
import wexpect.legacy_wexpect
|
|
import time
|
|
|
|
cmd = 'echo hello app'
|
|
|
|
p=wexpect.host.SpawnPipe(cmd)
|
|
p.expect('app')
|
|
print(p.before)
|
|
del(p)
|
|
|
|
time.sleep(3)
|
|
|
|
p=wexpect.legacy_wexpect.spawn(cmd)
|
|
time.sleep(.5)
|
|
p.expect('app')
|
|
print(p.before)
|
|
time.sleep(5)
|
|
|