Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Sunday, June 10, 2018
Debugging Aids for Coursera Assignments
$ cat tests/20 | python3 by_learners/whaterver.py
after you've inserted enough cute text that can be spotted when something bad happens - maybe just an exit instead of a pdb.set_trace() ??
Ideally, keep a count of the input lines being parsed and dump out
print( "num lines .......... " , lin_count )
Then, you can just do
$ head 55 tests/20 | python3 by_learners/whatever.py
Probably seems lame to a true CS hacker, but ... as my dad used to say when we let a roach eluded the slipper every so often, "they too have a right to live"
Tried it? Didn't work? You're not the first to find out, neither am I :)
https://stackoverflow.com/questions/5843741/how-can-i-pipe-initial-input-into-process-which-will-then-be-interactive?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment