#1
|
|||
|
|||
Anyway to use variables in ReadString or WaitForString?
I've set up a function that logs into Cisco devices supplied via text file and runs commands also supplied from a txt file.
I need to capture all the outputs from the commands being run to a log file and need to be very specific about the ReadString and WaitForString entries every time the function is being run. I'm trying to use a variable in as follows. Code:
def commands(currentdevice): crt.Screen.Synchronous = True filep = open(LOGFILE, "ab+") for line in open(COMMANDFILE, "r"): crt.Screen.Send(line + '\r') data = crt.Screen.ReadString(currentdevice + "#") filep.write(data + "\n") crt.Screen.WaitForString(currentdevice + "#") return() Thanks! Last edited by miked; 05-10-2013 at 11:29 AM. Reason: Put code brackets around the Python code to keep the correct formatting |
Tags |
cisco , readstring , variables , waitforstring |
Thread Tools | |
Display Modes | Rate This Thread |
|
|