Skip to content

Instantly share code, notes, and snippets.

@ijharulislam
Last active July 23, 2017 08:57
Show Gist options
  • Save ijharulislam/e5277c26324cbd4020c5e5ce840b2a9b to your computer and use it in GitHub Desktop.
Save ijharulislam/e5277c26324cbd4020c5e5ce840b2a9b to your computer and use it in GitHub Desktop.
with open('TestReport.csv', 'w') as f:
dict_writer = csv.DictWriter(f, data[0].keys())
dict_writer.writeheader()
dict_writer.writerows(data)
with open('%s'%file_name, 'r') as f:
reader = csv.DictReader(f)
for row in reader:
raw_data = {
'shops_root_url': row['Shops_root_url'],
'via_page_url_regex': row['Via_page_url_regex'],
'single_shop_url_regex': row['Single_shop_url_regex']
}
data.append(raw_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment