0041 ||| Help requested from newbie |||
Alan Gauld
alan.gauld at gssec.bt.co.uk
Mon Jun 19 08:11:05 EDT 2000
> I am following Alan Gauld's Python tutorial
> (http://members.xoom.com/alan_gauld/tutor/tutindex.htm)
latest version (including the Spanish translation) is at:
http://www.crosswinds.net/~agauld
The xoom one is not quite as regularly updated as the
crosswinds one - and the latter is usually faster to access
too...
> ...and I am stuck
> in the midst of his "case study" grammar module. I get a consistent
> "loop over non-sequence" error (see below) that I can't get rid of.
> I've tried everything
Well you could have tried mailing me via the link at
the bottom of the tutorial page... :-)
The problem lies in the line:
groups = getCharGroups(infile)
Unfortunately a gremlin swallowed the line in getCharGroups
that returns a value so the line above overwrites the groups
list with garbage('None' in this case)... You can either:
add a line:
return groups
just before the 'except' of getCharGroups() or
change the groups = line to just
getCharGroups(infile)
BTW, The next section of the tutorial creates a much
better quality version of the grammar checker! :-)
> Would someone care to take the time to show me the light? I know it is
> some embarassingly simple mistake but I can't find the durn thing!
Sorry my mistake, I'd been meaning to update that page when i
first noticed the bug, but it had slipped my mind. I'll fix it
tonight, honest!
Alan g.
PS Your report stats function still has a reference
to sys.argv[1] - you'll need to remove that...
--
=================================================
This post represents the views of the author
and does not necessarily accurately represent
the views of BT.
More information about the Python-list
mailing list