Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>VSCode-InputNew to Visual Studio Code? Get it now.
VSCode-Input

VSCode-Input

williammu6

|
8,951 installs
| (0) | Free
stdin input for c++ and python programs
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info


VSCode Input

STDIN Input for C++ and Python programs through comment

VSCode Input is a extension for VScode which executes the program of the current open file and feeds as STDIN input the values provided in input comment.

The input is obtained through the comments written on top of the file like the examples shown in Usage

Inspirated by Sublime Input

VSCode Input Settings

It is possible to change path to executable and execution flags via Preferences: Open Settings.

Name Description
vscode-input.compile-command.cpp Specifies the compile command to run C++. You can add or remove flags if it's necessary, such as -std=c++-17.
vscode-input.run-command.py Specifies the command to execute program

Usage

C++

/*input
3
string_1
string_2
string_3
*/
#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    string s;

    cin >> t
    while (t--) {
        cin >> s;
        cout << s << endl;
    }
    return 0;
}

Python 3

"""input
3
string_1
string_2
string_3
"""
t = int(input())

while True:

    if t <= 0:
        break

    print(input())

    t -= 1

Output

string_1
string_2
string_3

Keyboard Shortcuts

  • Ctrl + Alt + b - vscode-input.Build - Builds and runs the program (⌘⇧B for Mac)
  • Ctrl + Alt + c - vscode-input.Cancel - Cancels current running program (⌘⇧C for Mac)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft