Sorry for the late response. I've been travelling internationally and
am just getting back to work.
So--thank you to everyone who responded!
To answer everyone's question I am dumping all of the data from a
mysql database, then creating a postgresql database, then inserting
the data into the
(top posting corrected)
En Mon, 21 Apr 2008 21:12:44 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
escribió:
> def escape(string):
> """
> Escape both single quotes and blackslashes
> >>> x = r"fun\fun"
> >>> escape(x)
> 'funfun'
> """
> string = string.replace
[EMAIL PROTECTED] wrote:
> Hi...
>
> Here's a weird problem...I'm trying to escape a bunch of data to put
> into a database.
Is it possible to use the database API and prepared statements to avoid
having to go through this exercise? Also, most database APIs work
natively in unicode, so creating
HTH --
Thank you for the response. I'm not sure I understand the last
sentence, although I think I get the idea. How do I create a proper
doctest?
Thanks
On Apr 21, 9:08 pm, MRAB <[EMAIL PROTECTED]> wrote:
> On Apr 21, 11:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hi...
On Apr 21, 11:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi...
>
> Here's a weird problem...I'm trying to escape a bunch of data to put
> into a database.
>
> Here's what I have:
>
> def escape(string):
> """
> Escape both single quotes and blackslashes
> >>> x = r"fun\fun"
Hi...
Here's a weird problem...I'm trying to escape a bunch of data to put
into a database.
Here's what I have:
def escape(string):
"""
Escape both single quotes and blackslashes
>>> x = r"fun\fun"
>>> escape(x)
'funfun'
"""
string = string.replace('\\', '')