Created
September 3, 2011 17:06
-
-
Save voluntas/1191471 to your computer and use it in GitHub Desktop.
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
# vim: fileencoding=utf8 | |
import csv | |
import cStringIO | |
def get_csv_data(): | |
return make_data() | |
def make_file(): | |
data = cStringIO.StringIO() | |
writer = csv.writer(data, quoting=csv.QUOTE_NONNUMERIC) | |
writer.writerows(make_data()) | |
return data.getvalue() | |
def make_data(): | |
result = [] | |
result.append(("1", "p", "python", 100, "あ")) | |
result.append(("2", "y", "python", 200, "い")) | |
result.append(("3", "t", "python", 300, "う")) | |
result.append(("4", "h", "python", 400, "え")) | |
result.append(("5", "o", "python", 500, "お")) | |
result.append(("6", "n", "python", 600, "か")) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment