Created
March 3, 2017 02:06
-
-
Save ultrakain/79758ff811f87dd11a8c6c80c28397c4 to your computer and use it in GitHub Desktop.
python csv read write
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf8 -*- | |
import csv | |
# read | |
with open('eggs.csv', 'rb') as csvfile: | |
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|') | |
for row in spamreader: | |
print ', '.join(row) | |
# append | |
with open('eggs.csv', 'a') as csvfile: | |
spamwriter = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL) | |
spamwriter.writerow(['단데', '000-000-0000', '매니저', '셀러']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment