Sunday, June 10, 2018

Debugging Aids for Coursera Assignments

If you're not doing the rigorous stress testing thing and looking to just get the max out of the supplied test-cases, then, try

$ 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

No comments: