title: Python: Convert non-specifically formatted string into dictionary?
body: <p>I'm scraping my router's connected devices page to get a list of who's home. If I set a short DHCP release, I can do this pretty easily through a different method. However, I'd like to instead be able to turn the following string into a dictionary to complete this a more optimal way:</p>
  
  <pre><code>wldev = [['eth1','8C:3A:E3:95:77:21',-85,54000,1000,31365,0],
  ['eth1','A4:77:33:0C:E0:BE',-41,72223,72223,42239,0],
  ['eth2','58:B0:35:7A:20:C1',-34,104000,130000,21017,1],
  ['eth2','A4:77:33:66:BC:F6',-48,39000,58500,43956,1]]
  </code></pre>
  
  <p>This actually comes out all on one line. The closest I can get is making it a tuple using:</p>
  
  <pre><code>wldev = wldev.replace(']','}')
  wldev = wldev.replace('eth0\''',', 'eth0\': {').replace('eth1\''',', 'eth1\': {').replace('eth2\''',', 'eth2\': {').replace('br0\''',', 'br0\': {').replace('br1\''',', 'br\': {')
  wldev = wldev.replace('0}', '0\'}}').replace('1}', '1\'}}').replace(',','\',\'').replace('\'\'','\'').replace('\',\'{',',{')
  </code></pre>
  
  <p>But this is ugly. I'm new to Python and don't know much about RegEx, but surely there must be an easier way. Probably something simple. Any ideas?</p>