I am using Popen from subprocess library and wish to pass a variable to popen.stdin.write for executing a bat file. I wish to execute my bat file by
C:\Users\7zx3we\test.bat chinni
Mycode
from subprocess import Popen,PIPE
p = Popen('cmd.exe ', stdin=PIPE, stdout=PIPE)
name = 'chinni'
p.stdin.write('C:\Users\7zx3we\test.bat ' + name + '\n')
But this is giving me a syntax error and failing to run. What can I try to resolve that?