2023/05/26

Using the VSCode extension "Code Runner"


"Code Runner" is an extension that makes it easy to run programs.

How to use

There are 3 ways to execute the program:

execute program 1

execute program 2

If nothing is selected, the entire code will be executed.
If selected, only the selected code will be executed.

execute selected program

Setting

Here is the recommended settings.
The settings can be accessed through configuration page.

code runner setting

code-runner.executorMap

You can configure the execution commands for each language.
By default, Python does not support execution within a virtual environment.
Therefore, the settings for Python should be as follows:

"code-runner.executorMap": 
{
    "python" : "$pythonPath -u $fullFileName"
},

code-runner.runInTerminal

You can configure whether to execute programs in the terminal or not.
By default, it is set to false (not using the terminal).
If you need to use features like standard input, set it to true.

"code-runner.runInTerminal": true



Comment (github account is required)