[英]How to open my project in visual studio 2019 using python code
My goal is to build my project automatically using python in visual studio 2019. I'm able to open visual studio using python code (by importing subprocess
and calling it) but when I open particular code file in visual studio it's throwing error:我的目标是在 Visual Studio 2019 中使用 python 自动构建我的项目。我可以使用 python 代码(通过导入
subprocess
进程并调用它)打开 Visual Studio,但是当我在 Visual Studio 中打开特定代码文件时,它会抛出错误:
File couldn't be found and cannot be loaded
找不到文件,无法加载
When the same file I'm opening manually it is getting opened in visual studio, and the whole project is visible there as well.当我手动打开同一个文件时,它会在 Visual Studio 中打开,整个项目也在那里可见。
But with python code it is throwing error.但是使用 python 代码会引发错误。
Solution:解决方案:
subprocess.Popen([r"PathofVS2019-executable",r"PathofYourProjectFolder"])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.