30-days-of-python_Day 14

This lecture is talking about how to interpret CSV files.

import csv

with open(“data.csv”, “w+”) as csv.

writer = csv.writer(csvfile).

writer.writerow([“Title”, “Description”])

writer.writerow([“Row 1”, “Some desc”])

There are some different type to enter.

Also, you can read and write something that types.

‘r’ — Read mode which is used when the file is only being read 
‘w’ — Write mode which is used to edit and write new information to the file (any existing files with the same name will be erased when this mode is activated) 
‘a’ — Appending mode, which is used to add new data to the end of the file; that is new information is automatically amended to the end 
‘r+’ — Special read and write mode, which is used to handle both actions when working with a file

CSV file

Show your support

Clapping shows how much you appreciated Jeff Cheng’s story.