watches
John J. Lee
jjl at pobox.com
Sun Oct 12 17:48:56 EDT 2003
Lupe <luis_ at iname.com> writes:
> I'm starting programming in python and I'd like to know how do you keep
> track of the value of the variables in your code when you're debbuging it.
>
> example:
> for a in [1,2,3,4,5]:
> for b in [a,d,f,g,h,j]:
>
> how do keep track of the values of a & b, going step by step, ie, line by
> line? do you do it by hand? Do you use any kind of debbuger like pdb?
print a
print b
:-)
You just don't get the same species of resilient cockroach-like bugs
that you do in, say, C or C++. No compilation stage, no memory
allocation bugs, no hideous C++ complexity, so personally I find print
statements quite sufficient. This is particularly useful thanks to
the consistent (ish) use of __repr__ and __str__ everywhere. Other
people swear by pdb and various IDEs, though.
John
More information about the Python-list
mailing list