Skip to content

Instantly share code, notes, and snippets.

@csytan
Created June 16, 2010 22:20
Show Gist options
  • Save csytan/441356 to your computer and use it in GitHub Desktop.
Save csytan/441356 to your computer and use it in GitHub Desktop.
f = open('/path/csv.txt', 'r')
entities = []
for line in f:
arg1, arg2, arg3 = line.split(',')
data = models.SomeData(arg1=arg1, arg2=arg2, arg3=arg3)
entities.append(data)
if len(entities) > 40:
db.put(entities)
entities = []
db.put(entities)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment