Sandip Nath
Sandip Nath

Reputation: 644

no input can be typed in the output console of VSCode

I have installed vscode to run Python. The programs shows the output in the output window but refuses to take any input, such as if the user is to feed in his/her name, nothing is displayed what is being typed in. As for example, in the below program:

name = input("What's your name? ")
print("Hello ", name, " welcome to Python!")

It's showing the prompt to the user "What's your name? ". but nothing can be typed in? What's the problem here?

Upvotes: 1

Views: 8734

Answers (2)

Chris
Chris

Reputation: 3519

I use VS Code very sparingly and so the other answer was not very helpful. Here are some detailed steps.

screenshot of numbered steps

  1. Open the debug view from the panel with 5 large-ish buttons on the far left.
  2. Select the .NET Core Launch configuration at the top.
  3. Click the gear to the right of the configuration dropdown (opens launch.json).
  4. Look for the 'console' json entry, and change it to match this:

    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            ...
            "console": "integratedTerminal",
            ... 
        },
    

Upvotes: 1

see sharper
see sharper

Reputation: 12025

You need to configure the debugger:

1 Open the file to be debugged

2 From the debug configuration select Integrated Terminal/Console

3 Start debugging

If you don't have the integrated terminal open, press CTRL+~ to bring it up.

You can also use the normal terminal by choosing External Terminal/Console at step 2 above.

Upvotes: 1

Related Questions