Created
September 25, 2016 12:08
-
-
Save j-iNFINITE/3d5a0b3c664ceffaed053dcae3364254 to your computer and use it in GitHub Desktop.
python sqlte3相关
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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