# read Rows from CSV File
import csv
def read_csv_file(filename):
with open(filename, encoding='utf-8', newline='') as file:
return list(csv.reader(file))
# write Rows to CSV File
def write_to_csv_file(filename, rows):
with open(filename, 'w', encoding='utf-8', newline='') as file:
writer = csv.writer(file)
writer.writerows(rows)