3

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 Answer 1

6

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.

Adding another launcher

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

Sign up to request clarification or add additional context in comments.

2 Comments

Nice! I can switch configurations even I run same code, with different arguments!
El magnifeco! Danken

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.