I have a generic script in another language which I use to query an ASA5500 firewall. Because of thousands of possibilities in even the 'show' commands, I write small .cmd files which are macro-executed from the main script. A .cmd file looks something like
outfile("config.dat")
showline("terminal pager 50000",0)
makebuff(2000000)
showline("show running-config",1)
writefile()
showfile()
Each of the functions, i.e showline() are in the generic script; it simply opens the .cmd file and processes each line (processed as Tab-separated commands).
;process individual command lines
For i=1 To n
command = StrTrim(ItemExtract(i,cCmd,@TAB))
If StrLen(command)>3
Execute %command%
Endif
Next
The essential part is Execute %command%, which becomes the same as [for example] showline("terminal pager 50000",0)
So, assuming I can replicate the functions like showline() in Python, is there a way I can execute from the .cmd file? Hope this makes sense.