menu
If you’re interested in configuring a setup similar to the one depicted below, the following instructions could assist you in setting it up on your workstation.

Follow the instructions to set up VSCode for Python:
1. The first step is to download Visual Studio Code. You can find tons of tutorials on how to download VSCode. Skip this step if you have already installed VSCode.
2. Create a folder anywhere you want and open that folder using Visual Studio Code. In this tutorial my folder name is “code”.

3. After this step, you need to create three files:
- my_code.py (where you will be writing your code)
- input.txt (where you will be giving your test cases)
- output.txt (where the output will be displayed)

4. To split the files and have a similar view, follow the following steps.
5. Select the my_code.py file and then:
- – go to view,
- – then go to editor layout,
- – and then go to split left.

6. This will be your updated screen.

7. Now select the output.txt file from the right side and repeat the steps given below:
- – go to view,
- – then go to editor layout,
- – and then go to split down.

8. This will be your updated screen.

9. After creating and aligning the input and output files, the next step is to run them. To verify that our input produces the desired output, we’ll need to configure it. Open the Terminal, navigate to Configure Tasks, opt for creating a tasks.json file from the template, and then select ‘others’.
Terminal -> Configure Tasks -> Create tasks.json file from templates -> Others



10. You will see a new file has been created named tasks.json. Clear everything from tasks.json and paste the code given below.

11. Paste the code below.
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile and run",
// Type of task (shell command).
"type": "shell",
// Command to be executed (in this case, Python).
"command": "python",
// Arguments to be passed to the command.
"args": [
"${relativeFile}", // The name of the Python file.
"<", // Input redirection.
"input.txt", // Input file.
">", // Output redirection.
"output.txt" // Output file.
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "py",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"dependsOn": []
}
]
}

12. Now you are all set, to run the code just press CTRL + SHIFT+ B.

Can you configure vscode for c++ as you did for python?
Hi Sir Thank You For This,
However, I’m not able to see the output i used the command you have said and could you please tell me how this could be configured to JavaScript as well
Excellent.
Keep it up bro.