title: Is there a way to update a database table with a python dictionary?
body: <p>I am trying to write data back into the column of a database table.</p>
  
  <p>The data is stored in a python dictionary, because I need the key to identify the row I want to update.</p>
  
  <p>Here a snippet of my code so far:</p>
  
  <pre class="lang-py prettyprint-override"><code>l = []
  for line in text:
      soup = bs(line, 'html.parser')
  
      for script in soup(["script", "style"]):
          script.extract() 
  
      autor = soup.get_text()
  
      s = autor.replace('\n', '')
      l.append(s)
  
  dictW = dict(zip(t,l))
  
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>sql = 'UPDATE tablename SET Reintext WHERE = ...'
  cursor.executemany(sql, dictW)
  </code></pre>
  
  <p>dictW looks like this :</p>
  
  <pre class="lang-py prettyprint-override"><code>{'file:/C:/Users/125.html' : 'long string of a html file'}
  </code></pre>
  
  <p>I am stuck at the UPDATE statement. </p>
  
  <p>How can I write it to update the database table with the values in the dictionary while using the keys as identifier?</p>