Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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..

like image 796
jef Avatar asked Mar 06 '26 03:03

jef


1 Answers

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.

like image 97
ifconfig Avatar answered Mar 08 '26 16:03

ifconfig



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!