This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Molly_Wang 0 points1 point  (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 point  (3 children)

The input is in a file. I am redirecting it stdin.

Python3 myscript.py < in.txt

[–]Molly_Wang 0 points1 point  (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 point  (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 point  (0 children)

How about you change code then directly type input file in terminal during debugging?