Formatting data to output in web browser from web form

Harlin Seritt harlinseritt at yahoo.com
Sat Jul 9 13:38:25 CEST 2005


Hi,

I am using CherryPy to make a very small Blog web app.

Of course I use a textarea input on a page to get some information.
Most of the time when text is entered into it, there will be carriage
returns.

When I take the text and then try to re-write it out to output (in html
on a web page), I notice the Python strings don't translate these
special characters (carriage returns) to a "<p>" so that these
paragraphs show up properly in html for output. I tried doing something
like StringData.replace('\n', '<p>'). Of course this doesnt work
because it appears that '\n' is not being used.

Is there anything I can do to make sure paragraphs show up properly?

Thanks,

Harlin Seritt




More information about the Python-list mailing list