On Tue, 2007-05-01 at 14:00 -0700, Paul McGuire wrote: > On May 1, 3:45 pm, Tobiah <[EMAIL PROTECTED]> wrote: > > I wanted to do: > > > > query = "query text" % tuple(rec[1:-1].append(extra)) > > > > but the append() method returns none, so I did this: > > > > fields = rec[1:-1] > > fields.append(extra) > > query = "query text" % tuple(fields) > > query = "query text" % tuple(rec[1:-1] + [extra]) > > should work.
In addition to the above good advice, in case you are submitting a query to a DB-API compliant SQL database, you should use query parameters instead of building the query with string substitution. If you aren't querying an SQL database, never mind. -Carsten -- http://mail.python.org/mailman/listinfo/python-list