Skip to content

Instantly share code, notes, and snippets.

@rchamarthi
Created December 2, 2017 15:57
Show Gist options
  • Save rchamarthi/ff4fc57fe3c6546b515d2c5ea4800a4f to your computer and use it in GitHub Desktop.
Save rchamarthi/ff4fc57fe3c6546b515d2c5ea4800a4f to your computer and use it in GitHub Desktop.
string to csv write python
import csv
row = 'abc,xyz'.split(',')
print(row)
with open('eggs.csv','w') as csvfile:
spamwriter = csv.writer(csvfile, delimiter='|',
quotechar='"', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment