Re: Question about string.printable and non-printable characters

2005-03-21 Thread Sibylle Koczian
Michael Hoffman schrieb: string.printable is a least-common denominator ASCII set. You can certainly make it string.printable + "aeioun" (replacing the ASCII letters with their accented versions in your codeset of course). There is something I don't understand about string.printable: on the one ha

Re: Question about string.printable and non-printable characters

2005-03-15 Thread Michael Hoffman
Daniel Alexandre wrote: CheckPrintable(self,message): printablemessage = "" for char in message: if char in string.printable: printablemessage = printablemessage + char return printablemessage That would probably be best written (using Python 2.4) as: def check_printable(self,

Question about string.printable and non-printable characters

2005-03-15 Thread Daniel Alexandre
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I'm using the following method in my program to check whether a message received is printable or not and to strip the non-printable characters: CheckPrintable(self,message): printablemessage = "" for char in message: if char in string.pr