watches

L

Lupe

hi,

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?
 
J

John J. Lee

Lupe said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,166
Messages
2,570,907
Members
47,448
Latest member
DeanaQ4445

Latest Threads

Top