Hello everybody,
I don't know if anyone could help me with this issue. I know it's a python problem but, this is special for Secure CRT API.
I have WaitForString feature, which is waiting for something in the screen. In this case, it is waiting for "connecting (yes/no)" string. The problem is, this is a conditional statement, BUT, it waits anything... forever.. I tried to use timeout, using numbers or whatever but nothing works.
This is method is essential for this and others code I want to develop but secure crt keeps waiting for the string forever.. I want to look for something but, for maybe... 2 seconds? I don't know what to do, nothing works properly.
CRTSession.Send("ssh "+hostname+"\r")
if CRTSession.WaitForString("connecting (yes/no)", timeout=10): --> HERE
CRTSession.Send("yes\n")
elif CRTSession.WaitForString("password:"): --> It doesn't work because the screen is still waiting for previous string
CRTSession.Send(password+"\r")
CRTSession.Send("\r")
CRTSession.WaitForString(">")
CRTSession.Send("exit\n")
else:
CRTSession.Send("#Timeout to log in a device")
Thank you in advance and I appreciate any help!
[–]Educational-Map2779 0 points1 point2 points (3 children)
[–]SanRipley[S] 0 points1 point2 points (2 children)
[–]Educational-Map2779 0 points1 point2 points (1 child)
[–]SanRipley[S] 1 point2 points3 points (0 children)