Skip to content

Instantly share code, notes, and snippets.

@j-min j-min/ forked from solidpple/
Created Nov 17, 2016

What would you like to do?
import csv
import os
def get_csv_writer(filename, rows, delimiter):
with open(filename, 'w') as csvfile:
fieldnames = rows[0].keys()
writer = csv.DictWriter(csvfile, fieldnames=fieldnames, delimiter=delimiter)
for row in rows:
except Exception as detail:
print type(detail)
print detail
def get_csv_reader(filename, delimiter):
reader = []
if not os.path.isfile(filename):
csvfile = open(filename, "w")
csvfile = open(filename, "rb")
reader = csv.DictReader(csvfile, delimiter=delimiter)
return list(reader)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.