title: Converting a string to dictionary in python
body: <p>I have the following string :</p>
  
  <pre><code>str = "{application.root.category.id:2}"
  </code></pre>
  
  <p>I would like to convert the above to a dictionary data type in python as in :</p>
  
  <pre><code>dict = {application.root.category.id:2}
  </code></pre>
  
  <p>I tried using eval() and this is the error I got:</p>
  
  <blockquote>
    <p>AttributeError: java package 'application' has no attribute "root"</p>
  </blockquote>
  
  <p>My current python is of &lt;2.3 and I cannot update the python to >2.3 . </p>
  
  <p>Any solutions ?</p>