Skip to content

Instantly share code, notes, and snippets.

@j-iNFINITE
Created September 25, 2016 12:08
Show Gist options
  • Save j-iNFINITE/3d5a0b3c664ceffaed053dcae3364254 to your computer and use it in GitHub Desktop.
Save j-iNFINITE/3d5a0b3c664ceffaed053dcae3364254 to your computer and use it in GitHub Desktop.
python sqlte3相关
def dict_factory(cursor, row):
return dict((col[0], row[idx]) for idx, col in enumerate(cursor.description))
cursor.row_factory=dict_factory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment