Jan-07-2022, 07:08 PM
(Jan-07-2022, 06:34 PM)Bipinjohnson Wrote: Also in the error message what are those extra characters (\x1b[2J\x1b[1dEnable QSE API? (Y/n) )?These are probably ANSI terminal escape sequences. Never mind about them, it's a long story.
My suggestion was to shorten the expect string in line 4:
return_val=child.expect(["Enable QSE API"])This should be enough to recognize the line. If it works you should also strip all characters that activate regular expressions from line 12. Oh and make it also a list by adding square brackets, otherwise the return code may not be zero.
And also: Are you sure a timeout of 3 seconds is sufficient? What happens if you leave the timout default (30)?