title: Escape string Python for MySQL
body: <p>I use Python and MySQLdb to download web pages and store them into database. The problem I have is that I can't save complicated strings in the database because they are not properly escaped.</p>
  
  <p>Is there a function in Python that I can use to escape a string for MySQL? I tried with <code>'''</code> (triple simple quotes) and <code>"""</code>, but it didn't work. I know that PHP has <code>mysql_escape_string()</code>, is something similar in Python?</p>
  
  <p>Thanks.</p>