On Sat, Apr 20, 2013 at 4:46 PM, Colin J. Williams <c...@ncf.ca> wrote:
> Below is part of a script which shows the changes made to permit the script
> to run on either Python 2.7 or Python 3.2.
>
> I was surprised to see that the CSV next method is no longer available.
>
> Suggestions welcome.
<snip>
>     if ver == '2':
>        headerLine= inData.next()
>     else:  # Python version 3.3
<snip>
>         headerLine= inData.__next__()

Use the built-in next() function
(http://docs.python.org/2/library/functions.html#next ) instead:
    headerLine = next(iter(inData))

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to