Use the python db api to quote mysql values