title: extract a dictionary key value from a string
body: <p>I am currently in the process of using python to transmit a python dictionary from one raspberry pi to another over a 433Mhz link, using virtual wire (vw.py) to send data. </p>
  
  <p>The issue with <code>vw.py</code> is that data being sent is in string format.</p>
  
  <p>I am successfully receiving the data on PI_no2, and now I am trying to reformat the data so it can be placed back in a dictionary.</p>
  
  <p>I have created a small snippet to test with, and created a temporary string in the same format it is received as from vw.py</p>
  
  <p>So far I have successfully split the string at the colon, and I am now trying to get rid of the double quotes, without much success.</p>
  
  <pre><code>my_status = {}
  #temp is in the format the data is recieved
  temp = "'mycode':['1','2','firstname','Lastname']"
  
  key,value = temp.split(':')
  print key
  print value
  
  key = key.replace("'",'')
  value = value.replace("'",'')
  
  my_status.update({key:value})
  
  print my_status   
  </code></pre>
  
  <p>Gives the result</p>
  
  <pre><code>'mycode'
  ['1','2','firstname','Lastname']
  {'mycode': '[1,2,firstname,Lastname]'}
  </code></pre>
  
  <p>I require the value to be in the format</p>
  
  <pre><code>['1','2','firstname','Lastname']
  </code></pre>
  
  <p>but the strip gets rid of all the single speech marks.</p>