Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does 'rb' mean in csv files? [duplicate]

Tags:

python

csv

import csv
with open('test.csv','rb') as file:
    rows = csv.reader(file, 
                      delimiter = ',', 
                      quotechar = '"')
    data = [data for data in rows]

This was in Python: reading in a csv file and saving columns as variables. I couldn't comment, but I'm really confused. What does 'rb' mean?

like image 395
evtoh Avatar asked Jun 09 '16 14:06

evtoh


1 Answers

It means: Read the file in Binary mode.

For a complete list of options view this.

like image 155
Amin Alaee Avatar answered Sep 22 '22 20:09

Amin Alaee