#1
|
|||
|
|||
From VB to Python
Hi Folks!
Just switched my CRT over to my Mac and need help converting my TAC+ login scripts over to python. Below is a sample VB I use, hoping someone can post the equivalent in Python? Code:
#$language = "VBScript" #$interface = "1.0" Sub main ' turn on synchronous mode so we don't miss any data crt.Screen.Synchronous = True ' Wait for a string that looks like "login: " or "Username: " crt.Screen.WaitForString "Username: " ' Send your username followed by a carriage return crt.Screen.Send "steve" & VbCr ' Wait for a string that looks like "password: " or "Password: " crt.Screen.WaitForString "assword:" ' Send your password followed by a carriage return crt.Screen.Send "123abc" & VbCr ' Wait for a string that looks like "login: " or ">: " crt.Screen.WaitForString ">" ' Send your username followed by a carriage return crt.Screen.Send "en" & VbCr ' Wait for a string that looks like "password: " or "Password: " crt.Screen.WaitForString "assword:" ' Send your password followed by a carriage return crt.Screen.Send "abc123" & VbCr ' turn off synchronous mode to restore normal input processing crt.Screen.Synchronous = False End Sub |
#2
|
|||
|
|||
Hello sdibias,
Your best option is to use the script recorder. For a simple logon script such as posted, I expect it won't need very much post editing and it will allow you to see the indents and structure required by Python.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
It worked! I totally forgot about this feature, thanks for the reminder
![]() |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|