Created
January 29, 2012 23:40
-
-
Save groovecoder/1701382 to your computer and use it in GitHub Desktop.
AttributeError: 'module' object has no attribute 'writer'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import os | |
STORING_TO_CSV = False | |
if 'STORE_TO_CSV' in os.environ: | |
facilities_csv = csv.writer(open('thd_facilities.csv', 'w')) | |
inspections_csv = csv.writer(open('thd_inspections.csv', 'w')) | |
STORING_TO_CSV = True | |
print "Storing to CSV" | |
def save_facility(facility): | |
if STORING_TO_CSV: | |
facilities_csv.writerow(**facility.values()) | |
def save_inspection(inspection): | |
if STORING_TO_CSV: | |
inspections_csv.writerow(**inspection.values()) |
Thanks.. csv.py is the culprit.. don't use the name
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks i did the same