从python启动VS2008构建

时间:2008-11-04 22:19:59

标签: python windows visual-studio-2008 build-automation

如果我手动将它粘贴到命令提示符中,它可以工作,但是如果我从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')

1 个答案:

答案 0 :(得分:1)

我觉得反斜杠搞砸了你。您需要使用R字符串(原始)

R “字符串”

请参阅https://docs.python.org/2/reference/lexical_analysis.html#string-literals以获取参考资料