Wrapper for pexpect