repr(string)

Guilherme Polo ggpolo at gmail.com
Wed Jul 23 17:12:37 CEST 2008


On Wed, Jul 23, 2008 at 12:04 PM, David C. Ullrich <dullrich at sprynet.com> wrote:
> I've been saving data in a file with one line per field.
> Now some of the fields may become multi-line strings...
>
> I was about to start escaping and unescaping linefeeds
> by hand, when I realized that repr() and eval() should
> do. Hence the question: If s is a string, is repr(s)
> guaranteed not to contain line breaks?

In the sense that line breaks are quoted ? Yes, repr does that.

>
> --
> David C. Ullrich
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
-- Guilherme H. Polo Goncalves



More information about the Python-list mailing list