title: Python MySQL insert with list
body: <p>I am trying to insert data into MySQL with a list using Python.<br>
  The list contains both strings and integers.<br>
  I am not able to use %s for string replacement also % does not work.</p>
  
  <pre><code>def insert(self,data):
      db =  MySQLdb.connect(db=self.database,host=self.host,port=self.port,user=self.user,passwd=self.password)
      c=db.cursor()
      var_string = ', '.join('?' * len(data))
      query = 'INSERT INTO wmr200 (time, temp_in, temp_out, dewpoint, hum_in, hum_out, windspeed, wind_direction, windchill, rain_1h, rain_24h, rain_total, rel_pressure, abs_pressure, tendency, forecast) VALUES (now(), %s);' % var_string
      c.execute(query, data)
  </code></pre>
  
  <p>error is:  </p>
  
  <p>File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 159, in execute<br>
      query = query % db.literal(args)<br>
  TypeError: not all arguments converted during string formatting</p>