我试图按下面的方式打开一个可执行文件,并遇到以下错误,如何处理Program Files之间的空间和打开这个可执行文件?
C:\Windows\system32>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("C:\\Program Files (x86)\\company\\POST\\bin\\POSTConfig.exe")
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.更新:-
还希望python进程在POSTConfig.exe进程继续的情况下终止。
发布于 2016-07-26 19:19:42
请按以下方式运行:
os.system(r'"C:\Program Files (x86)\company\POST\bin\POSTConfig.exe"')发布于 2016-07-26 19:19:52
使用原始字符串,在单引号中嵌入双引号:
os.system(r'"C:\Program Files (x86)\company\POST\bin\POSTConfig.exe"')但是请看一下子过程模块。
https://stackoverflow.com/questions/38598034
复制相似问题