I'm trying to launch an executable from python subprocess and I have a problem with the path. I'm trying to run newman.cmd which is located in
C:\Users\<myself>\AppData\Roaming\npm
I try
subprocess.run("C:\Users\<myself>AppData\Roaming\npm\newman.cmd run","shell=True")
which fails, indicating:
Syntax Error: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape: C:\knxnet\test_differentiel.py, line 71, pos 23
subprocess.run("C:\Users\<myself>\AppData\Roaming\npm\newman.cmd run","shell=True")
If I copy newman.cmd and the appropriate folders in my local path, I end up launching the command as expected, ie. this works:
subprocess.run("newman.cmd -h")
I checked the path and it gives me the following:
ENV = <irrelevant info> ;C:\Users\<myself>\AppData\Roaming\npm
so I though it would find it ? how can I do to avoid copying executables in my current directory ?
thanks for any help ...