
If you don’t have a task.json file in your project you can create a new one with press Ctrl + Shift + B. py file and run it nicely with the shortcut Ctrl + Shift + B. Keep isShellCommand and version properties as unchanged.
Delete the last property problemMatcher. Select Python Run the debugger with the option Python: Current File (. Edit this file and add the args in this key-pair format AND add multiple for different args including Variable Substitution! "] (filename) Run your code with your debugger Go to the Debug panel. In the DEBUG pane, either click the Config button circled in red above or click the blue link "create launch.json file":Ĭlick it and it creates a launch.json file with debugging configurations. However, it supports two or more configurations, and they appear in the left-hand menu/pane's drop down list (instead of "No Configurations"). Visual Studio Code only supports one launch.json file. Tags : python,debugging,visual-studio-code
However, it is annoying to modify the launch.json file every time just because I want to use different arguments. I know I can add a custom configuration in the launch.json file with the args keyword. Is there an easy way to run a Python file inside Visual Studio Code with arguments?