Re: urllib.quote() and cgi.escape()

Oleg Broytmann <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
On Tue, Jan 17, 2006 at 08:40:57AM -0800, Titus Brown wrote:
> How do you escape "'"?
> 
> e.g.
> 
> <input type='text' name='blah' value='%(value)s'>
> 
> where value="contains'quotes\"of all kinds"?

Python: quoted_value = cgi.escape(value, 1)

HTML  : <input type="text" name="blah" value="%(quoted_value)s">

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [email protected]
           Programmers don't die, they just GOSUB without RETURN.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.