Is it possible to read a line from a batch file in to a python script?
I have a .bat file that contains the following:
rem generated from template
Set A_version= 9.0.0
set App_name = test
for line in open('name.bat', 'r'): if 'A_version' in line: A_version = line.split('=')[-1].strip() break
This will search for the string, assign the value to a variable of the same name and break out of the loop in case the variable is referenced later in the bat, we don't need that.