Better string.translate?

Steve Holden sholden at holdenweb.com
Thu Mar 15 03:37:27 EST 2001


"Stowasser Harald" <stowasser.h at idowa.de> wrote in message
news:3ab0749f$1_3 at news.zet.net...
> "Steve Purcell" <stephen_purcell at yahoo.com> schrieb :
> > Use the 'sub' function in the 're' module:
>
> Thank you, but i don't want do delete the characters. I need to
> translate them into Spaces.
>
> Anybody knows how?
>
I'm not sure I understand ... your original code was intended to translate
punctuation marks into spaces? In my newsreader I suspect that a load of
spaces in the second argument to maketrans() were trimmed as part of a
line-wrap, so the code wasn't too obvious.

Perhaps you could explain again what it is you want to do.

regards
 Steve






More information about the Python-list mailing list