How to set multiple launch.json or different arguments in same project folder at Visual Studio Code?

落爺英雄遲暮 提交于 2021-02-10 19:06:25

问题


I usually run python code at Visual Studio Code. And sometimes I open a folder which contains several applications. For example, I use examples repository like https://github.com/pytorch/examples

If I open pytorch/examples folder, it contains many main.py and they need different arguments for each. In such a case, is there any ways to prepare multiple launch.json? configurations in launch.json is array, so it may be a solution in my case..


回答1:


As you had begun to realize, VS Code allows for multiple launch configurations.

You can create one (or another) configuration by going to the debug menu on the left side of the window, clicking the dropdown for selecting which launch configuration to use, and clicking Add Configuration.

When you want to switch configurations, just select the one you want to use from the same dropdown menu.



来源:https://stackoverflow.com/questions/46353737/how-to-set-multiple-launch-json-or-different-arguments-in-same-project-folder-at

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!