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.

Colin W.


def main():
    global inData, inFile
    if ver == '2':
       headerLine= inData.next()
    else:  # Python version 3.3
        inFile.close()
        inFile= open('Don Wall April 18 2013.csv', 'r', newline= '')
        inData= csv.reader(inFile)
        headerLine= inData.__next__()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to