def escape_html(s):
    """
	Escapes a string so that it can be displayed as HTML. This is useful for
	example for tracebacks, which use <> characters.

	Arguments:
	s	--	A string to escape. We assume Unicode input. str objects may cause
			decoding errors.

	Returns:
	An escaped string.
	"""
    l = [(u'&', u'&amp;'), (u' ', u'&nbsp;'), (u'\t',
        u'&nbsp;&nbsp;&nbsp;&nbsp;'), (u'<', u'&lt;'), (u'>', u'&gt;')]
    for orig, new in l:
        s = s.replace(orig, new)
    return s
