replacement for string.printable

John K Masters johnmasters at
Wed Aug 15 20:56:01 CEST 2007

>From what I have read the string module is obsolete and should not be
used but I am working on a project that parses printable files created
in a DOS program and creates a web page for each file. I am using the
string.printable constant to determine which characters should be kept;
the files contain many print control codes. There seems to be nothing
like this in the string methods. isalnum() seems the nearest but gives
false for '+' '!' etc.

I realise I could define a global string to cover this but wondered if
there was another, better, way

Regards, John
War is God's way of teaching Americans geography
Ambrose Bierce (1842 - 1914)

More information about the Python-list mailing list