Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 11-10-2014, 09:36 AM
helpme helpme is offline
Registered User
Join Date: Nov 2014
Posts: 2
Python logging via script

I'm using a python script to automate several things in our environment. When the script runs it seems to send an extra return when trying to sign in. I've used different variations of login methods such as waitforstrings with an array, but it always turns out the same way.

Script excerpt:
for eachDevice in strDevices:

CurrentTab = crt.GetScriptTab()
CurrentTab.Screen.Synchronous = True
CurrentTab.Screen.IgnoreEscape = True
CurrentTab.Screen.Send("telnet " + eachDevice + "\r")
Login = CurrentTab.Screen.ReadString(":")
if Login.find("sername")>-1:
CurrentTab.Screen.Send(Username + "\r")
elif Login.find("ogin")>-1:
CurrentTab.Screen.Send(Username + "\r")

Old code (still happened here and there was a delay too using this code)
#while True:
#CurrentTab.Screen.Send(Username + "\r")

ACS5.5 username:
% Authentication failed (notice how no username is entered)

ACS5.5 username: [username]
ACS5.5 password:

At this point it logs in successfully. The extra return seems to be only when it initially connects.

SecureCRT ver 7.2.5
Reply With Quote

login , python , script

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 03:56 PM.