wexpect-venv/issues/i03_wait_on_eof.py
2019-11-14 16:05:54 +01:00

22 lines
375 B
Python

import wexpect
import time
p = wexpect.spawn('uname')
time.sleep(0.5)
p.expect(wexpect.EOF)
print(p.before)
p = wexpect.spawn('uname')
time.sleep(0.8)
p.expect(wexpect.EOF)
print(p.before)
p = wexpect.spawn('uname')
time.sleep(1.1)
p.expect(wexpect.EOF)
print(p.before)
p = wexpect.spawn('uname')
time.sleep(1.5)
p.expect(wexpect.EOF)
print(p.before)