VanDyke Software Forums

VanDyke Software Forums (
-   General (
-   -   loop failed to execute by python (

somenasty 05-15-2019 02:39 AM

loop failed to execute by python

# $language = "Python"
# $interface = "1.0"

# Connect to a telnet server and automate the initial login sequence.
# Note that synchronous mode is enabled to prevent server output from
# potentially being missed.

def main():

        crt.Screen.Synchronous = True

        # connect to host on port 23 (the default telnet port)
        #count = crt.Arguments
        count = 0
    while count<5 :
          # crt.Screen.WaitForString("Enter password>")
          # crt.Screen.Send("arristi\r")
        count = count +1
        crt.Screen.Synchronous = False


jpellegrini 05-15-2019 08:56 AM

Hi somenasty,

You mention that the loop is failing to execute.

What exactly is it failing at doing?

Does it give you any error message or any information?

I notice some indentation issues in your script. In Python, white space is important because it is used as the delimiter between scopes (ie: what is in the function main() as a whole vs. what is in the while loop). Therefore, the while loop may execute better if you do the following:


while count<5 :
                count = count + 1

All times are GMT -6. The time now is 10:56 PM.