a bug with csv module in python
Question: 
    import csv
    with open('database.csv') as csvfile:
        reader = csv.DictReader(csvfile)
        for row in reader:
            print(row['NAME'])
    

Guys, I have a csv file with the first row as a index, and in linux the code
read from row['NAME'] and print only the names form colum NAME, when I run it
in windows, it says:

    
    
    C:\Users\Desktop>python py.py
    Traceback (most recent call last):
      File "py.py", line 5, in <module>
        print(row['NAME'])
    KeyError: 'NAME'
    

WHY?


Answer: If you are using the python 2- versions, you need to open the csv with rb,
i.e.:

    
    
    with open('database.csv', 'rb') as csvfile:....
    

for reference, checkout <https://docs.python.org/2/library/csv.html> as it
includes a part in the reader doc about this.

