title: python :: howto parse json and access element
body: <p>I am trying to parse a json that in the raw form look like this :  </p>
  
  <pre><code>{'OK': True, 'Value': 43768746}  
  </code></pre>
  
  <p>i am doing this :  </p>
  
  <pre><code>line = line.strip().decode("utf-8")  
  j_proper = json.dumps(line)  
  j = json.loads(j_proper)  
  print  j['Value']  
  </code></pre>
  
  <p>but i get the error :  </p>
  
  <pre><code>print  j['Value']  
  TypeError: string indices must be integers  
  </code></pre>
  
  <p>if i print line, j_proper, j and their types i get this :  </p>
  
  <pre><code>{'OK': True, 'Value': 43768746}  
  &lt; type 'unicode'&gt;  
  "{'OK': True, 'Value': 43768746}"  
  &lt; type 'str'&gt;  
  {'OK': True, 'Value': 43768746}  
  &lt; type 'unicode'&gt;  
  </code></pre>
  
  <p>What is the correct recipe to parse such a json and access the "Value" number?<br>
  Thank you!</p>