Advertisement
Guest User

Untitled

a guest
Mar 27th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. from itertools import zip_longest
  2.  
  3. list_values = range(37000) # big yoba data
  4. howmany = 1000
  5.  
  6. for values in zip_longest(fillvalue=0, *[iter(list_values)] * howmany):
  7. cursor.executemany("""INSERT INTO my_table VALUES(%s);""", values)
  8. db.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement