Hello,
New to Python. I am working on learning the code, but I have a question to see what I am up against. I had written a few scripts in VBS that we use for automating device configurations, but unfortunately they won't work for the new guys that use MACs. The terminal software will only open Python scripts.
My goal is to pull data from a tab delimited text file, assign each field to an array variable and then insert that variable into a string that is pushed to the CLI prompt as it comes up. I know the following code is not correct, just trying to show my intent.
filename:config.txt
array(0)=ipaddr1
array(1)=ipmask
array(2)=ipgatew
VSP9000(config#)> ip adress [ipaddress1]
VSP9000(config#)> ip mask [ipmask]
VSP9000(config#)> ip default-gateway [ipgatew]
I also want to recreate the ability to have the script access multiple lines of data from the text file and loop each time the series of commands is completed and then grab the next line from the text file. Any help or advice is greatly appreciated.
New to Python. I am working on learning the code, but I have a question to see what I am up against. I had written a few scripts in VBS that we use for automating device configurations, but unfortunately they won't work for the new guys that use MACs. The terminal software will only open Python scripts.
My goal is to pull data from a tab delimited text file, assign each field to an array variable and then insert that variable into a string that is pushed to the CLI prompt as it comes up. I know the following code is not correct, just trying to show my intent.
filename:config.txt
array(0)=ipaddr1
array(1)=ipmask
array(2)=ipgatew
VSP9000(config#)> ip adress [ipaddress1]
VSP9000(config#)> ip mask [ipmask]
VSP9000(config#)> ip default-gateway [ipgatew]
I also want to recreate the ability to have the script access multiple lines of data from the text file and loop each time the series of commands is completed and then grab the next line from the text file. Any help or advice is greatly appreciated.