I have a very specific command that I want to run during my python script:
"C:\Program Files\Some Folder\application.exe" /config:"C:\Program Files\Some Folder\my_config.ini"
Including the quotation marks.
my_config.ini is a a configuration file used to specify parameters for the application on startup.
The command works perfectly when I type it into cmd, but I cant get it work in vscode python ...
import os
# i have tried these
os.system('"C:\Program Files\Some Folder\application.exe" /config:"C:\Program Files\Some Folder\my_config.ini"')
os.system('"C:\Program Files\Some Folder\application.exe"' + ' /config:' + '"C:\Program Files\Some Folder\my_config.ini"')
os.system("C:\Program Files\Some Folder\application.exe /config:C:\Program Files\Some Folder\my_config.ini")
They all give this error:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
EDIT:
Given this question and answer: os.system to invoke an exe which lies in a dir whose name contains whitespace
Im trying to use this code:
file = 'C:\\Program Files\\Some Folder\\application.exe'
subprocess.call([file])
and this works! but I still cant figure out how to add the config file to it...