I'm reading a JSON with:
# coding: utf8 import urllib2 import json response = urllib2.urlopen('https://example.com/test.json') data = json.load(response) print data['mykey'] # {u'readme': u'Caf\xe9'} but I see two things:
Every string is prefixed with
u, i.e. type 'unicode'\xe9instead ofé
How to do this properly with Python 2.7?
"How do this properly with Python 2.7?"What are you trying to do exactly? You haven't described why the prefix is an issue or why the characters are an issue either. You say you want to "output the data to screen before storing anything in the DB" and one answer shows that you can print it to the screen and my answer shows a way you could save it with the characters intact. What is the issue? What is your actual question?python myscript.py, it works, see stackoverflow.com/q/48975692/1422096.