Skip to content

Instantly share code, notes, and snippets.

@mcescalante
Created December 4, 2017 02:40
Show Gist options
  • Save mcescalante/82972e99b3a251bc67569d7b549dc2a6 to your computer and use it in GitHub Desktop.
Save mcescalante/82972e99b3a251bc67569d7b549dc2a6 to your computer and use it in GitHub Desktop.
# Select those values, get them to be json
c.execute('select * from data')
data = c.fetchall()
print data
# Data will print: [(u'{"test": "test2"}',)]
# To load the JSON for python use
for item in data:
print json.loads(item[0])
# Data will print: {u'test': u'test2'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment