This is probably a really simple issue, but I am having the hardest time with it. I'm trying to execute a command prompt command in Python, but since I have spaces in the path (C:\Program Files\etc) it says that "C:\Program" is not a recognized command
So far I have tried to use the escape character backslash \
to interpret the spaces as actual spaces, but this didn't work. I also tried doing ('"'+chkcmd+'"')
but that didnt work either. Here is the simple code I'm trying to use:
chkcmd = "C:\Program Files\whatever.exe"
os.system(chkcmd)
Any help would be greatly appreciated. Thank you!