在Python中运行命令

2024-10-01 11:41:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我是python新手。有什么不起作用的原因吗:


C:\Python27>python
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> cmdBuilder = os.path.join("C:\\","Program Files","InstallShield","2011 SAB",
"System","IsCmdBld.exe")
>>> os.system(cmdBuilder)
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
1
>>>

可执行文件确实存在。它似乎被程序和文件之间的空间所困扰

谢谢


Tags: orosontypebit原因programnov