title: I am trying to read a text file and turn it into a list of dictionaries Python
body: <p>the way i need to read in the file:</p>
  <pre class="lang-py prettyprint-override"><code>countries = [
  {
      &quot;name&quot;: &quot;Venezuela&quot;,
      &quot;capital&quot;: &quot;Caracas&quot;
  }, {
      &quot;name&quot;: &quot;Bolivia&quot;,
      &quot;capital&quot;: &quot;Sucre&quot;
  }, {
      &quot;name&quot;: &quot;Argentina&quot;,
      &quot;capital&quot;: &quot;Buenos Aires&quot;
  }, {
      &quot;name&quot;: &quot;Chile&quot;,
      &quot;capital&quot;: &quot;Santiago&quot;
  }, {
      &quot;name&quot;: &quot;Colombia&quot;,
      &quot;capital&quot;: &quot;Bogota&quot;
  }, {
      &quot;name&quot;: &quot;Guyana&quot;,
      &quot;capital&quot;: &quot;Georgetown&quot;
  }, {
      &quot;name&quot;: &quot;French Guiana&quot;,
      &quot;capital&quot;: &quot;Cayenne&quot;
  }, {
      &quot;name&quot;: &quot;Paraguay&quot;,
      &quot;capital&quot;: &quot;Asuncion&quot;
  }, {
      &quot;name&quot;: &quot;Peru&quot;,
      &quot;capital&quot;: &quot;Lima&quot;
  }, {
      &quot;name&quot;: &quot;Ecuador&quot;,
      &quot;capital&quot;: &quot;Quito&quot;
  }, {
      &quot;name&quot;: &quot;Suriname&quot;,
      &quot;capital&quot;: &quot;Paramibo&quot;
  }, {
      &quot;name&quot;: &quot;Uruguay&quot;,
      &quot;capital&quot;: &quot;Montevideo&quot;
  }, {
      &quot;name&quot;: &quot;Brazil&quot;,
      &quot;capital&quot;: &quot;Brasilia&quot;
  }]
  </code></pre>
  <p>how the text file is set up:</p>
  <pre class="lang-none prettyprint-override"><code>Venezuela,Caracas
  Bolivia,Sucre
  Argentina,Buenos Aires
  Chile,Santiago
  Colombia,Bogota
  Guyana,Georgetown
  French Guiana,Cayenne
  Paraguay,Asuncion
  Peru,Lima
  Ecuador,Quito
  Suriname,Paramibo
  Uruguay,Montevideo
  Brazil,Brasilia
  </code></pre>
  <p>the text file:</p>
  <p><img src="https://i.stack.imgur.com/NAa93.png" alt="the text file" /></p>
  <p>current code that works without reading in the file</p>
  <p><img src="https://i.stack.imgur.com/f3Qpy.png" alt="current code that works without reading in the file" /></p>