问题
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