Web Images Videos Maps News Groups Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion How do you htmlentities in Python

View parsed - Show only message text

Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!feeder.news-service.com!newsgate.cistron.nl!xs4all!transit3.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path: <ebgs...@gmail.com>
X-Original-To: python-l...@python.org
Delivered-To: python-l...@bag.python.org
X-Spam-Status: OK 0.040
Date: Mon, 4 Jun 2007 22:31:56 +0900
From: "js " <ebgs...@gmail.com>
To: python-l...@python.org
Subject: How do you htmlentities in Python
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-BeenThere: python-l...@python.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: General discussion list for the Python programming language
	<python-list.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/listinfo/python-list>,
	<mailto:python-list-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list>
List-Post: <mailto:python-l...@python.org>
List-Help: <mailto:python-list-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
	<mailto:python-list-requ...@python.org?subject=subscribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.8674.1180963921.32031.python-list@python.org>
Lines: 17
NNTP-Posting-Host: 194.109.207.14
X-Trace: 1180963921 news.xs4all.nl 324 [::ffff:194.109.207.14]:58737
X-Complaints-To: abuse@xs4all.nl

Hi list.

If I'm not mistaken, in python, there's no standard library to convert
html entities, like &amp; or &gt; into their applicable characters.

htmlentitydefs provides maps that helps this conversion,
but it's not a function so you have to write your own function
make use of  htmlentitydefs, probably using regex or something.

To me this seemed odd because python is known as
'Batteries Included' language.

So my questions are
1. Why doesn't python have/need entity encoding/decoding?
2. Is there any idiom to do entity encode/decode in python?

Thank you in advance...

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google