#1
|
|||
|
|||
Python Script - Creating a new tab/session
I'm having trouble figuring out how to get my python script started. I need to create a script that starts by creating a new session/tab. I want to make sure when you launch the script it starts by creating a new tab/session (in whatever order that should happen). I'm getting lost in the documentation on how to generate that at the beginning.
What am I missing here to get this off the ground? |
#2
|
|||
|
|||
Hi dougbert,
Can you please elaborate on where you are getting lost in the documentation? You will want to take a look at the 'Session' object and the 'ConnectInTab' method in SecureCRT's Help. I have also attached an example script, "ConnectToMultipleHostsInTabs.py.txt", that you will likely find helpful. Does this information help you to get started?
__________________
Thanks, --Brittney VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Thanks Brittney,
The Session/ConnectInTab function was what I was looking for. I've got a script working now that will read in a CSV file that contains a list of hosts and a list of interfaces that need to be reconfigured. I needed the script to connect to each host and then parse the interfaces out and perform commands on each of them and then save. I ended up using function from the RunCommandsonMultipleHostsAndLogResults to close the tabs each host ends up opening up: Code:
if g_objNewTab.Index <> crt.GetScriptTab().Index: g_objNewTab.Close() |
#4
|
|||
|
|||
Hi dougbert,
Thanks for following up! I am glad to hear that the ConnectInTab method worked well for you and that you were also able to make use of the "RunCommandsonMultipleHostsAndLogResults" script example! Thanks for sharing! Keep Well! ![]()
__________________
Thanks, --Brittney VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
launch , python , session , tab |
Thread Tools | |
Display Modes | Rate This Thread |
|
|