Killing Another Bug

MRAB python at mrabarnett.plus.com
Fri Dec 4 11:43:56 EST 2009


Victor Subervi wrote:
> Hi;
> I have this code:
>  
[snip]
>  
> As you can see in the supplied comments, when I loop through for table 
> 'prescriptions', it only prints out the first element of each variable. 
> When I loop through for table 'products', it prints out all of them! Why?
> 
If you're serious about killing bugs, DON'T USE BARE EXCEPTS, especially
ones which contain only "pass"!

As for you're problem, it's not clear to me which one is behaving
correctly. You should add more print statements to tell you where it is 
in the code, and then read through the output, checking the logic. Are
the values what you expect? Is it following the route through the code
that you expect?



More information about the Python-list mailing list