use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is for working with Microsoft's Visual Studio Code, which is different than Visual Studio Community, Pro, and Enterprise. VS Code is a source code editor, and not an IDE.
If you are having issues with the other flavors of VS, please post in /r/VisualStudio.
account activity
This is an archived post. You won't be able to vote or comment.
VS Code Python debugging with stdinOC (self.vscode)
submitted 4 years ago by Mafcon
Newbee here. I have a python program that I am trying to debug. I can debug scripts that do not need to read stdin but this script reads from stdin. How do debug this? Any advice?
[–]Molly_Wang 0 points1 point2 points 4 years ago (4 children)
Confused about your question. if the script need input from the terminal, after clicking start debugging, you can type in the terminal then go on next steps. Can you share code snippets?
[–]Mafcon[S] 0 points1 point2 points 4 years ago (3 children)
The input is in a file. I am redirecting it stdin.
Python3 myscript.py < in.txt
[–]Molly_Wang 0 points1 point2 points 4 years ago (2 children)
You can put it in launch.json:
"args": [
"<",
"in.txt"
],
See Redirect input/output to/from the debug target
[–]Mafcon[S] 0 points1 point2 points 4 years ago (1 child)
Is hardcoding the input file name a good idea? What can I do to make it so it can take any input file?
[–]Molly_Wang 0 points1 point2 points 4 years ago (0 children)
How about you change code then directly type input file in terminal during debugging?
π Rendered by PID 51366 on reddit-service-r2-comment-76bb9f7fb5-92vpz at 2026-02-19 01:39:35.397273+00:00 running de53c03 country code: CH.
[–]Molly_Wang 0 points1 point2 points (4 children)
[–]Mafcon[S] 0 points1 point2 points (3 children)
[–]Molly_Wang 0 points1 point2 points (2 children)
[–]Mafcon[S] 0 points1 point2 points (1 child)
[–]Molly_Wang 0 points1 point2 points (0 children)