Skip to content

Instantly share code, notes, and snippets.

@llimllib
Created January 14, 2010 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llimllib/277499 to your computer and use it in GitHub Desktop.
Save llimllib/277499 to your computer and use it in GitHub Desktop.
valuestr = ", ".join("%%(%s)s" % r for r in column_names)
fetchnone_query(conn, """
INSERT INTO %%(table_name)s (%%(column_names)s)
VALUES (%s)
""" % valuestr, locals())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment