title: How to convert a string with unwanted characters ('[' , ' " ') to a list?
body: <p>I have a server-client communication, and the server is sending data forming a list, then json.dumping the list and sending through the socket. Python 3.6 is asking me to encode() it before sending, so I'm doing it like this:</p>
  
  <pre><code>a = []
  for g in whoto.keys():
      a.append(g)
  b = json.dumps(a)
  conn.send(b.encode())
  </code></pre>
  
  <p>On the client side, the result of a recv and decode() gives me a string "representing" a list. The result and type are as follows:</p>
  
  <pre><code>decoded =  ["user", "oppan"] type = &lt;class 'str'&gt;
  </code></pre>
  
  <p>I need to use the elements of what-would-be a list to form a ListBox in one of the GUI in the clients. I'm able to come close to it with .split(), but the ' [ " " , ] ' characters show up with the content. Code:</p>
  
  <pre><code>dado = dado2.split()
  print(dado, 'type =', type(dado))
  print('tipo :', type(dado), 'lenght :', len(dado))
  </code></pre>
  
  <p>returning me:</p>
  
  <pre><code>['["user",', '"oppan"]'] type = &lt;class 'list'&gt;
  tipo : &lt;class 'list'&gt; lenght : 2
  </code></pre>
  
  <p>What's the best way to have a clean list?
  Thanks in advance!</p>