Skip to content

Instantly share code, notes, and snippets.

@voluntas
Created September 3, 2011 17:06
Show Gist options
  • Save voluntas/1191471 to your computer and use it in GitHub Desktop.
Save voluntas/1191471 to your computer and use it in GitHub Desktop.
# 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