Skip to content

Instantly share code, notes, and snippets.

@isann
Created June 18, 2012 11:59
Show Gist options
  • Save isann/2948036 to your computer and use it in GitHub Desktop.
Save isann/2948036 to your computer and use it in GitHub Desktop.
csvからデータを読み込む(ダブルクォーテーションの改行フィールドもよろしくしてくれる)
# -*- coding: utf-8 -*-
import csv
__author__ = 'isann'
def main():
filename = 'data.csv'
file = open(filename)
dialect = csv.excel
for row in csv.reader(file, dialect):
print(row)
# for elem in row:
# print(elem)
file.close()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment