MySQLdb + Python + quotes
Jeff Bauer
jbauer at rubic.com
Tue May 9 17:54:55 EDT 2000
More information about the Python-list mailing list
Tue May 9 17:54:55 EDT 2000
- Previous message (by thread): MySQLdb + Python + quotes
- Next message (by thread): MySQLdb + Python + quotes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Lars Hoeyrup Jensen wrote:
> I use the MySQLdb module to make Python interact with
> MySQL. I have a problem, when I try to insert strings
> that contain special characters (here I primarily think
> of quotes: ' and "). There _must_ be a smart
> way to escape these characters.
>>> import MySQLdb
>>> MySQLdb.escape_string("""some '"' quotes""")
'some \\\'\\"\\\' quotes'
Jeff Bauer
Rubicon Research
- Previous message (by thread): MySQLdb + Python + quotes
- Next message (by thread): MySQLdb + Python + quotes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list