Python 3.1.1 sql = "INSERT INTO `tbl` VALUES (NULL, '%s', '%s', '%s', '%s', '%s');" for row in fp: print (sql, (row[0],row[1],row[2],row[3],row[4])) . INSERT INTO `tbl` VALUES (NULL, '%s', '%s', '%s', '%s', '%s'); ('142', 'abc', '2006-04-09 02:19:24', '', '') . Why is it showing %s in the output ?
1. I dont want to sql % () because that doesnt escape the strings 2. I cant use conn.escape_string(r) because Im not connected to a database. Output script to file and import to database loated elsewhere. -- Anjanesh Lekshmnarayanan -- http://mail.python.org/mailman/listinfo/python-list