expect method

return_value = obj.expect(clause, ...)

Wait for input from the (un)spawned object and match against the patterns. Return the value of the clause that matched.

If obj.cont() is called within one of the clauses, then expect will not return, but will wait for additional input and perform the matching again.