Python and encodings drives me crazy

Steven Bethard steven.bethard at gmail.com
Mon Jun 20 16:44:22 EDT 2005


Oliver Andrich wrote:
> def remove_html_entities(data):
>   for html, char in html2text:
>     data = apply(string.replace, [data, html, char])
>   return data

I know this isn't your question, but why write:

 >     data = apply(string.replace, [data, html, char])

when you could write

     data = data.replace(html, char)

??

STeVe



More information about the Python-list mailing list