On Thu, 01 Jul 2010 23:30:33 +0100, Rhodri James wrote: > On Thu, 01 Jul 2010 23:07:53 +0100, Josh English ><joshua.r.engl...@gmail.com> wrote: > >> On Jul 1, 2:50 pm, Matt McCredie <mccre...@gmail.com> wrote: >>> >>> My guess is that the "if True" is actually something >>> else, and it isn't being interpreted as "True". As such, "fws_last_col" >>> never >>> gets assigned, and thus never gets created. You can fix that by >>> assigning >>> fws_last_col to an appropriate default value before the for loop. >> > [snip] >> fws_first_col = 6 >> >> for student in sorted(data.keys() ): >> #~ print student >> >> tracker = data[student] >> >> if tracker.hasFWS(): >> >> idx = fws_first_col >> >> >> for _month in iter(_monthnumbers): >> idx += 2 >> fws_last_col = idx >> >> fws_month_count_col = idx + 4 >> fwsrow += 1 >> >> print fws_last_col > [suggests that hasFWS() is always False]
Another possibility is that data.keys() is empty. -- To email me, substitute nowhere->spamcop, invalid->net. -- http://mail.python.org/mailman/listinfo/python-list