#1
|
|||
|
|||
crt.Screen.WaitForStrings Python
Hello,
I am writing a script in Python that allows me to delete a file on a switch. To that I need to wait for a string to appear on the screen of my console. I'm Using the instruction crt.Screen.WaitForStrings but it dosen't work. Can you help me? That's my code Code:
# $language = "python" # $interface = "1.0" # This automatically generated script may need to be # edited in order to work correctly. def pause(): import time time.sleep(1) pause() def reload(): crt.Screen.Synchronous = True crt.Screen.Send("reload" + chr(13)) crt.Screen.Send("y") reload() def MiniBoot(): crt.Screen.WaitForStrings("#Press s to STOP AT MINIBOOT...") crt.Screen.Send("s") MiniBoot() Last edited by jdev; 02-26-2021 at 08:46 AM. Reason: Please wrap code with a [CODE] tag at the beginning and a [/CODE] tag at the end. |
#2
|
|||
|
|||
crt.Screen.WaitForStrings
Hello,
I'm Curently writting a script in Python to remove Users on Alcatel Switch To do that I need to reload the switch and start it in miniboot. To start the switch in miniboot I need to press S when the message "Press s to STOP AT MINIBOOT..." apear on my console screen. Then I wrote that code and it dosen't work, the S is not send it seem's Is someone can help me please? Code:
def reload(): crt.Screen.Synchronous = True crt.Screen.Send("reload" + chr(13)) crt.Screen.Send("y") reload() def MiniBoot(): crt.Screen.Synchronous = True a = "Press s to STOP AT MINIBOOT..." vWaitForStrings = crt.Screen.WaitForStrings(a) if vWaitForStrings == a: crt.Screen.Send("s") MiniBoot() Last edited by jdev; 02-26-2021 at 08:46 AM. Reason: Please wrap code with a [CODE] tag at the beginning and a [/CODE] tag at the end. |
#3
|
||||
|
||||
Dear FabriceCarboni,
If your script isn't working like you expect, the first place to go would be this post: FAQ: Why doesn't my SecureCRT script work like I need it to?Read through the information in that post, and adjust your script accordingly. Additional notes include:
Read through the guide I linked to earlier, and make the needed adjustments to your script. If you require additional assistance, please provide more information about what is showing up on your screen from start to finish as your script is running, and include any error messages you might be seeing as a result of any python language syntax errors, etc. --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|