The use of prepared statements with MySQL in Python is explained, for example, at http://zetcode.com/db/mysqlpython/ - look at this page for Prepared statements.
In your case, it will be, for example:
sql = ('INSERT INTO {} (date, time, tag, power) VALUES '
'(%s, %s, %s, %s)'.format(self.db_scan_table))
and then, in a loop, as you put it:
self.cursor.execute(sql, (d, t, tag, power))
- MySQLdb ( , .. ..).
, "", , , .execute_many ( ) ( ).
: mysql own Connector/Python prepare=True .cursor() factory - . http://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursorprepared.html. , ( " , PREPARE EXECUTE" , mysql.com), , ; " , " " " (import this , ). MySQLdb ( , ) , Connector/Python .