Easily read from and write to CSV files.
Source Code
import csv
# Writing to a CSV file
with open('output.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow(["Name", "Age"])
writer.writerow(["Alice", 24])
# Reading from a CSV file
with open('output.csv', 'r') as file:
reader = csv.reader(file)
for row in reader:
print(row)