Skip to content

Instantly share code, notes, and snippets.

@rugbyprof
Last active February 14, 2020 02:13
Show Gist options
  • Select an option

  • Save rugbyprof/61f9f9e5f703a367d4a3 to your computer and use it in GitHub Desktop.

Select an option

Save rugbyprof/61f9f9e5f703a367d4a3 to your computer and use it in GitHub Desktop.
create csv python
import csv
my_csv_file = open('/tmp/sample.csv', 'w')
csv_writer = csv.writer(my_csv_file)
sample_row = ('Michael', 1234, 23.46, 'San Francisco, California')
# Write a CSV row
csv_writer.writerow(sample_row)
# Result: Michael,1234,23.46,"San Francisco, California"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment