title: How to split comma delimited values into multiple rows using Python
body: <p>I'm using Python and SQLite to manipulate a database. </p>
  
  <p>I have an SQLite Table <code>Movies</code> that looks like this:</p>
  
  <pre><code>| ID             | Country     
  +----------------+-------------
  | 1              | USA, Germany, Mexico 
  | 2              | Brazil, Canada
  | 3              | Peru
  </code></pre>
  
  <p>I would like to split the comma delimited values in <code>Country</code> and insert them into <strong>another table</strong> <code>Countries</code> so that <code>Countries</code> table looks like this </p>
  
  <pre><code>| ID             | Country     
  +----------------+-------------
  | 1              | USA
  | 1              | Germany
  | 1              | Mexico
  | 2              | Brazil
  | 2              | Canada
  | 3              | Peru
  </code></pre>
  
  <p>How do I do split the values from <code>Country</code> column in <code>Movies</code> table and insert them into <code>Country</code> column in <code>Countries</code> table?</p>
  
  <p>According to <a href="https://stackoverflow.com/questions/12744155/sqlite-create-new-columns-from-column-containing">this post</a>, I can't accomplish this task using pure SQLite. How would I go about it using Python?</p>