Well, thatβs a subtle reaction to Aaronβs answer, but I donβt think he understands what you want to interactively debug at some point, right? This works, but the program exits before you get the opportunity to debug.
(echo cont;cat bar.in) | python -m pdb foo.py
I think if you can edit foo.py do import pdb and then at foo.py point of interest do pdb.set_trace() and just run python foo.py without -m pdb and give it bar.in usually
python foo.py < bar.in
Peter Lyons
source share