简体   繁体   English

如何使用 python 代码在 Visual Studio 2019 中打开我的项目

[英]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.

相关问题 如何在 Visual Studio 2019 中将 python 代码与 C# 集成 - How to integrate python code with C# in Visual Studio 2019 Visual Studio Community 2019 创建项目但无法打开它创建的项目? - Visual Studio Community 2019 creates a project but cannot open the project it created? 如何在 Visual Studio 2019 中打开/编辑 exe - How to open / edit an exe in visual studio 2019 如何在 Visual Studio 2019 中打开手表 Window - How to open the Watch Window in Visual Studio 2019 带有 C# 的 Visual Studio 2019:停用“优化代码”会使我的项目崩溃 - Visual Studio 2019 with C#: Deactivation of "Optimize code" crashes my project Visual Studio 2019不会在项目打开时提取所需的Docker映像 - Visual Studio 2019 does not pull required Docker images at project open 如何在 Visual Studio 2019 中查看代码的实现? - How to see implementation of code in Visual Studio 2019? 如何使用 Visual Studio 2019 中的控制台项目测试 .net 5 WPF 项目? - How can I test a .net 5 WPF project using a console project in Visual Studio 2019? Visual Studio 2019无法将新文件添加到我的项目中 - Visual Studio 2019 fails to add a new file to my project 如何在Visual Studio 2019中将wwwroot目录添加到我的WebAPI项目 - How do I add a wwwroot directory to my WebAPI project in Visual Studio 2019
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM