"Don Hiatt" <> wrote in message
news: om...
> Is there an easy way to remove multiple non-printable
> (e.g. "not strings.printable") from a string? Perhaps
> something like foo.replace(list_of_nonprintables, '')
> if it only existed?
>>> help(str.translate)
translate(...)
S.translate(table [,deletechars]) -> string
Return a copy of the string S, where all characters occurring
in the optional argument deletechars are removed, and the
remaining characters have been mapped through the given
translation table, which must be a string of length 256.
>>> s_identity=''.join([chr(i) for i in range(256)]) # the 'table' you
need
Terry J. Reedy