On 18/11/2013 09:50, Oscar Benjamin wrote:
On 17 November 2013 13:33, Roy Smith <r...@panix.com> wrote:

So, I stick "assert 0" in the code an re-run the program to see if I get
an AssertionError.  If I do, then I know the code is being run.  If I
don't then I know it's not.  Either way, I know more about what's going
on than I did before.  Once I know what's going on, I remove the assert.

If the program is invoked from a terminal I would probably go with
'import pdb; pdb.set_trace()' rather than 'assert 0'. Then you can
check much more than whether or not the code is being executed. It's a
bit more to type but I type it so often that I can now type it *really
fast*.


Oscar


If I used something that often I'd either cut and paste it or have a key combination set up to insert it automatically. Or get my man to type it up for me :)

--
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to