Pexpect.expect#
- Pexpect.expect(ctl_id, *a, reject=None, **kw)[source]#
Wait for a pattern in one process’ output.
- Parameters:
ctl_id (
int) – spawned-process identifier.*a – positional arguments passed to
pexpect.expect.reject (
sequence) – regular expressions that abort the wait. If one matches before an expected pattern, anAssertionErrorcarrying the matched output is raised instead of waiting for the timeout. It surfaces over RPC asRemoteError.**kw – keyword arguments passed to
pexpect.expect.
- Returns:
(index, groups)of the match, as in pexpect. The index is relative to the expected patterns.- Return type:
tuple