import HTMLParser import sys h = HTMLParser.HTMLParser() print repr(h.unescape(sys.stdin.read()))