From: Peter Pearson on 1 Jul 2010 19:12
On Thu, 01 Jul 2010 23:30:33 +0100, Rhodri James wrote:
> On Thu, 01 Jul 2010 23:07:53 +0100, Josh English
>> On Jul 1, 2:50 pm, Matt McCredie <mccre...(a)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"
>>> gets assigned, and thus never gets created. You can fix that by
>>> fws_last_col to an appropriate default value before the for loop.
>> 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.
From: Josh English on 2 Jul 2010 18:00
On Jul 1, 3:30 pm, "Rhodri James" <rho...(a)wildebst.demon.co.uk> wrote:
> If this is a version of your code that actually fails when you run it
> (rather than being another artistic interpretation of a photograph of your
> code :-), then I'd go with Matt's analysis. This will give you a
> NameError for fws_last_col if tracker.hasFWS() happens to return False for
> all students.
Actually, tracker.hasFWS() was returning False for an entirely
different reason that I didn't expect until I had the script dump all
the information it was processing. Thanks for the clue. I added one
parameter to one function elsewhere and the thing seems to be working
Thanks for the help.