Laszlo Nagy wrote:
>
> Hi,
>
> I would like to have a function that can convert '>' into '>',
> '&' into '&' etc. I could not find how to do it easily (I have a
> code snippet for the opposite).
> Thanks,
>
> Laszlo
>
You can use htmlentitydefs module to help with this.
import htmlentityd
> I would like to have a function that can convert '>' into '>',
> '&' into '&' etc. I could not find how to do it easily (I have a
> code snippet for the opposite).
Found it, sorry
def convertentity(m):
"""Convert a HTML entity into normal string (ISO-8859-1)"""
if m.group(1)=='#':