如果我手动将它粘贴到命令提示符中,它可以工作,但是如果我从python运行它,我会得到The filename, directgory name, or volume label syntax is incorrect
。
os.system('%comspec% /k ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86')
os.system('devenv Immersica.sln /rebuild Debug /Out last-build.txt')
答案 0 :(得分:1)
我觉得反斜杠搞砸了你。您需要使用R字符串(原始)
R “字符串”
请参阅https://docs.python.org/2/reference/lexical_analysis.html#string-literals以获取参考资料