Python script reading from sys.stdin and debugger

rocky rocky at gnu.org
Fri May 20 04:31:01 EDT 2016


On Thursday, May 19, 2016 at 5:10:08 PM UTC-4, Fillmore wrote:
> Hello PyMasters!
> 
> Long story short:
> 
> cat myfile.txt | python -m pdb myscript.py
> 
> doens't work (pdb hijacking stdin?).
> 
> Google indicates that someone has fixed this with named pipes, but, call 
> me stupid, I don't understand how I need to set up those pipes, how I 
> need to modify my script and, above all, how I now need to invoke the 
> program.
> 
> Help and suggestions appreciated. I am using Python 3.4 on Cygwin and 
> Ubuntu.
> 
> Thanks

The debugger trepan3k follows the gdb command set so it gdb's "source" command. See 
http://python2-trepan.readthedocs.io/en/latest/commands/support/source.html or type "help source" inside the debugger. To install trepan3k "easy_install trepan3k" (I'm not totally sure pip install works yet). See https://pypi.python.org/pypi/trepan3k/ for mor details.



More information about the Python-list mailing list