#๐Ÿ”’ how to feed input to debugged process in pdb?

5 messages ยท Page 1 of 1 (latest)

cedar crescent
#

it is taken as input to pdb, not debugged process, I'd like something like (gdb) run < input.txt

jiao ~/playground $ echo hello | python3 stdin.py
type a line
jiao ~/playground $ echo hello | python3 -m pdb stdin.py
> /home/jiao/playground/stdin.py(1)<module>()
-> input("type a line\n")
(Pdb) *** NameError: name 'hello' is not defined
(Pdb)

I know I can provide input when debugged process ask for it but I'd like to provide all input at once at startup

soft knollBOT
#

@cedar crescent

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

cedar crescent
#

!close

soft knollBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.