Skip to content

Instantly share code, notes, and snippets.

@abeger
Created October 23, 2012 00:47
Show Gist options
  • Save abeger/3935950 to your computer and use it in GitHub Desktop.
Save abeger/3935950 to your computer and use it in GitHub Desktop.
Read a CSV in Python
import csv
f = open('mycsv.csv','r')
try:
reader = csv.reader(f)
for row in reader:
print row
finally:
f.close()
@abeger
Copy link
Author

abeger commented Oct 28, 2012

For reading semicolon-delimited CSV: csv.reader(f, delimiter=';')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment