I am trying to get some Unicode characters printed out or written to a text file and am running into Errors..please advice, trying to google gave me a few hints but that error ed too..below is my code..What might I be doing wrong here..
I am trying to eventually use 'requests' and parse JSON with data that has Unicode values..
I am trying to parse JSON using requests from this url
https://api.discogs.com/releases/7828220
try:
import requests
import json
url = 'https://api.discogs.com/releases/7828220'
headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0' }
art = requests.get(url, headers=headers)
json_object = json.loads(art.text)
try:
print str(json_object['companies'][0][name])
except:
print "Genre list isn't defined"
{u'name': u'\u041e\u041e\u041e "\u041f\u0430\u0440\u0430\u0434\u0438\u0437"', u'entity_type': u'10', u'catno': u'PARAD-432', u'resource_url': u'https://api.discogs.com/labels/210403', u'id': 210403, u'entity_type_name': u'Manufactured By'}
Here json_object['companies'][0][name] has a few Unicode characters that wont display on the command line terminal and also wont write to a file with the required output (Unicode)
Actual output looks like "ООО "Парадиз"",
how can I get python to interpret these values as it appears?