Oct-30-2021, 02:50 PM
Maybe the following can help
https://pexpect.readthedocs.io/en/stable...t-patterns Wrote:Special EOF and TIMEOUT patterns
There are two special patterns to match the End Of File (EOF) or a Timeout condition (TIMEOUT). You can pass these patterns to expect(). These patterns are not regular expressions. Use them like predefined constants.
If the child has died and you have read all the child’s output then ordinarily expect() will raise an EOF exception. You can read everything up to the EOF without generating an exception by using the EOF pattern expect. In this case everything the child has output will be available in the before property.
...
... (see the link for more)