[mod_python] Problem with html quoted/unquoted

Trevor Hennion trevor at thennion.demon.co.uk
Tue May 23 03:58:25 EDT 2006

Wouter van Marle wrote:
> On Tue, 2006-05-23 at 01:49 -0400, Joshua Ginsberg wrote:
>> Wouter --
>> You used % to do string substitution on the first argument to execute() 
>> as opposed to passing a tuple as a second argument to execute().
> I don't get your meaning.
> Can you please give me the lines of code as example? Thanks!
> Wouter.


I have been stuggling to understand this as well

I believe that it should look like this:

s = """This is 'some' stuff with "quotes" and stuff"""
cursor.execute('INSERT INTO testtable (field1) VALUES (%s)', (s,))

If this is incorrect please somebody put me right!


Trevor Hennion

More information about the Mod_python mailing list