samedi 18 janvier 2020

python mixing pexpect and another if condition

when we run such a code script stops at second line until what we expect occurs. s=something we spect child = pexpect.spawn(some commands) child.expect(s, timeout=None)

is it possible that while expecting s, doing something else?for example s may occurs after 5 minutes but meanwhile i want to check another thing every 5 seconds. like this: if (s occurred in pexpect) or (another event occurred in another code) then continue script.

Aucun commentaire:

Enregistrer un commentaire