View Single Post
Old 10-05-2019, 12:38 AM
rlupi001 rlupi001 is offline
Registered User
Join Date: Oct 2019
Posts: 2
Python Scripting trying to clone session more than 9 times


First of all i'd like to thank anyone that can help me with this.

I am running a script that I want to take a list of hosts and run a session into a step server and clone this session multiple times in order to login to each host in my list. However, i find that after 9 cloned tabs my connections seem to not execute properly anymore and just skip each host to the end of the file..

Is there a limit that is going on here that does not let me open and send cmds to more then 9 cloned tabs/windows? Here is my code:
sessionsFileName = os.path.expanduser("~") + "\SessionList.txt"
	if not os.path.exists(sessionsFileName):
			"Session list file not found:\n\n" +
			sessionsFileName + "\n\n" +
			"Create a session list file as described in the description of " +
			"this script code and then run the script again.")

	sessionFile =, "r", "utf-8")
	sessionsArray = []

	for line in sessionFile:
		session = line.strip()
		if session:	# Don't add empty lines/sessions


	# Connect to each session and issue a few commands, then disconnect.
	Blahship = crt.Session.ConnectInTab("/S Blah-Blah\Blah-Blah")
	Blah2ship = crt.Session.ConnectInTab("/S Blah-CONSOLE\Blah-Blah")
	for session in sessionsArray:
                        #crt.Dialog.MessageBox("Connecting to Session: " + session)
			t = session.split()
			tt = t[0]
			console = t[1]
			if console.startswith("11.2."):
				drone = Blah2ship.Clone()
				drone = Blahship.Clone()
			#drone.Screen.Synchronous = True
			drone.Caption = tt
			drone.Screen.Send("/home/fjordman/dist/inception/inception " + console + "\r")
			drone.Screen.WaitForString("Select a reality: ", 10)
		except ScriptError:
Reply With Quote