Skip to content

Instantly share code, notes, and snippets.

@danielholmstrom
Created July 13, 2015 17:09
Show Gist options
  • Save danielholmstrom/86912c9efca919836b9b to your computer and use it in GitHub Desktop.
Save danielholmstrom/86912c9efca919836b9b to your computer and use it in GitHub Desktop.
doc[row['key']] = row['trans']
# Write
output_path = os.path.join(output_dir, relpath[len(original_dir) + 1:])
output_path_dir = os.path.dirname(output_path)
if not os.path.exists(output_path_dir):
os.makedirs(output_path_dir)
with open(output_path, 'w') as csvfile:
writer = csv.writer(csvfile, delimiter=",", quotechar='"',
quoting=csv.QUOTE_ALL)
for k, v in doc.iteritems():
writer.writerow([k, v])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment