Escape problem

Thomas Guettler guettli at
Tue Mar 2 16:52:56 CET 2004

Am Tue, 02 Mar 2004 06:57:19 -0800 schrieb ketulp_barod:

> Hi
> I am developing a web application.
> I have a string 'foo"bar"' say in variable s.
> When I print s on the python shell it prints correctly 'foo"bar"'
> whereas when I try to display s on the form it just prints 'foo'. What
> should I do to print complete string 'foo"bar"' on the form


have a look at the HTML source-code. Does it look right?

If you want to use the value in an attribute,
you need to quote it:
 cgi.escape(s, 1)


More information about the Python-list mailing list