I am trying to get an output from a .bat file in a python script, code works fine if I hard code a variable value in .bat file, but I want that value to be dynamic.
This is code I am using to execute the external file.
command = 'C:/this/this.bat'
p = subprocess.Popen(command, universal_newlines=True,
shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
text = p.stdout.read()
retcode = p.wait()
file this.bat requires a user input but I am not sure how to provide it inside python script, e.g. from a variable. Thanks for the help.