debug print shortcut?

John Mudd mudd at vex.net
Sun Jun 6 08:28:09 EDT 2004


When debugging python, I add print statements such as these.  

print 'i=%s' % `i`
print 'foo()=%s' % `foo()`
print 'a,b,c=%s' % `a,b,c`

I just want to dump the value of a variable or expression.  But I
don't like having to type the expression twice, everytime.  I can
solve this in 'C' with a preprocessor macro.  Can it be solved in
python?

John



More information about the Python-list mailing list