I would like to to create a var with subprocess.Popen and read the content of the var.
I don't know how to use subprocess.Popen correctly, I tried :
p1 = subprocess.Popen('set var="something"', shell=True, stdin = subprocess.PIPE, stdout = subprocess.PIPE)
p2 = subprocess.Popen('echo var %var%', shell=True, stdin = p1.stdout, stdout = subprocess.PIPE)
p1.stdout.close()
out, err = p2.communicate()
print(out)
Output :
b'var %var%\r\n'
Any idea on how to do that ?