for loop question
rcdailey at gmail.com
Wed Oct 10 21:56:10 CEST 2007
I'm currently writing my own CSV parser since the built in one doesn't
support Unicode. I'm wondering if there's a way to iterate over the
characters in a unicode string and have access to both the 'current' and the
'next' characters each iteration. For example:
test = u"Hello World"
for cur,next in test:
Ideally, this would output:
Of course, the for loop above isn't valid at all. I am just giving an
example of what I'm trying to accomplish. Anyone know how I can achieve the
goal in the example above? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list