'Terminal not accepting inputs in visual code
Iam new to python. So my code was working just fine, until I opened the same program a few hours later. The language being used is Python, in Visual code. This is a screenshot of the output terminal.
The program prompts the user to either press 'M' or 'D'at the very beginning. However, when I do so, it dosen't register. Not only 'M' or 'D', but any charater entered isn't accepted. I have code runner extension istalled. As mentioned above, the input was being accepted a few hours prior to this. I installed visual code today itself, so it is the latest version. Please help.
Solution 1:[1]
Seems more like an issue/bug in Visual code. Try to run the program externally by going to the folder, opening a console window and running it by entering python hello_world.py, then you see where the issue comes from.
Edit: I don't use Visual Code personally, but this sounds similar to your problem: How to allow VS Code to take input from users?
Solution 2:[2]
It is not a python problem, maybe something with your VSCode or its extension, or your computer. Try to do the next steps:
- Reboot PC
- Restart VSCode
- Reinstall VSCode
- Try to use Shell, there is an example
- Try another PC
- Try an online python console like this one
- Install Linux instead of Windows
and so on.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Bauyrzhan Ospan |
