Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > General


Thread Tools Display Modes
Old 05-15-2019, 03:39 AM
somenasty somenasty is offline
Registered User
Join Date: May 2019
Posts: 1
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


Last edited by jdev; 05-15-2019 at 09:39 AM. Reason: Use code tags around code
Reply With Quote
Old 05-15-2019, 09:56 AM
jpellegrini jpellegrini is offline
Registered User
Join Date: Mar 2019
Posts: 20
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

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 01:39 AM.