A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/315391.html below:

multiple replaces

multiple replaces multiple replacesFredrik Lundh fredrik at pythonware.com
Fri Sep 16 07:59:35 EDT 2005
Harald Armin Massa wrote:

> sth. like
> rpdict={"<!--tree-->":"%(tree)s","<!--house-->":"%(house)s","%","%%"}
>
> for key, value in rpdict.iteritems():
>    h1=h1.replace(key, value)
>
> but ... without the garbage, in one command.
>
> I guess there are very, very, very wise solution for this problem, but
> I do not know of them.

http://effbot.org/zone/python-replace.htm

</F> 




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4