Jan Danielsson wrote:
> Robert Kern wrote:
> [---]
> 
>>>Hmm... On second thought, I need to escape more characters.
>>>
>>>Is there no other way to escape characters in strings?
>>
>>Which characters?
> 
> 
>    I need to escape '\n', '"', '[' and ']'. I finally went with a few of
> these:
> string.replace('\n', '\\n')
> string.replace('"', '\\"')

You might like this recipe:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81330

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to