I am trying to execute a windows command from python.
"C:\Program Files (x86)\IntelSWTools\VTune Amplifier 2018\bin64\amplxe-cl" -collect general-exploration-0 -app-working-dir "C:\Program Files (x86)\Google\Chrome\Application" --duration 180 -- "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
python is not able to parse this part
C:\Program Files (x86)\Google\Chrome\Application
I tried breaking up the query to narrow down the issue and tried using raw strings as well and forward slashes. Heres my code
import os
a =r'"C:/Program Files (x86)/IntelSWTools/VTune Amplifier 2018/bin64/amplxe-cl.exe"'
b=r' -collect general-exploration-0 -app-working-dir '
c= r"C:/Program Files (x86)/Google/Chrome/Application"
d=r' --duration 180 -- '
e=r'"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"'
z = a + b + c + d + e
os.system(z)
I am getting Error as 'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
Which is due to 'c' string in code.