MySQLdb: TypeError: not all arguments converted ...

Alex Martelli aleax at aleax.it
Tue Oct 14 12:42:05 EDT 2003


Yermat wrote:
   ...
> I have a question too because of this because now how can I do if I want
> the following request ?
> self.sqlSelect  = "select * from %s where id='%s'" %
> self.__class__.__name__

In any % formatting, double up the % characters in the format string
that you want to be preserved.  In other word, write a %%s -- for
example -- where you do not want substitution to occur, but just want
a %s to be left in the string resulting from the formatting.


Alex





More information about the Python-list mailing list