title: How to read dictionary data from a file in python?
body: <p>I have the following file dic.txt:</p>
  
  <pre><code>{'a':0, 'b':0, 'c':0, 'd':0}
  </code></pre>
  
  <p>I want to read its contents and use as a dictionary. After entering new data values I need to write them into that file. Basically I need a script to work with the dictionary, update its values and save them for later use.</p>
  
  <p>I have a working script, but can't figure out how to actually read the contents of the dic.txt into a variable in the script. Cause when I try this:</p>
  
  <pre><code>file = '/home/me/dic.txt'
  dic_list = open(file, 'r')
  mydic = dic_list
  dic_list.close()
  </code></pre>
  
  <p>What I get as mydic is a str. And I can't manipulate its values. So here is the question. How do I create a dictionary from a dic.txt?</p>