[Tutor] Program gets stuck after a creating a list from dictinary items!

Alan Gauld alan.gauld at btinternet.com
Sat Jul 7 01:06:28 CEST 2012


On 06/07/12 22:16, Ali Torkamani wrote:
> Actually printing some thing after that line does not show any thing,

OK, But it could be any of the lines above the print.
Why are you so sure its that line? You are probably correct but I'd like 
to know why you are so sure? What have you done to isolate the problem?

> have the pdb.set_trace()'s for debugging, to see what's going on inside.

So what does it show?

If you aren't using it get rid of it. The less distractions there are 
the easier it is to debug things.

> ho would you debug that?

I'd either add some more print statements or I'd run it inside a 
debugger. Winpdb is a good example. I'd set a break point at the loop 
then single step through the loop the first couple of times, then set 
one or more breakpoints inside the loop and run to those.
But my first choice would be the print statements.

One just before the loop, one just inside the loop showing the loop 
variable value so I know how often I've gone round.

HTH,

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/





More information about the Tutor mailing list