Checking for binary data in a string

Emile van Sebille emile at fenx.com
Sat Jun 20 01:56:57 CEST 2009


On 6/19/2009 1:18 PM Mitko Haralanov said...
> I have a question about finding out whether a string contains binary
> data?

<snip>

> The only other check that I can think of is to check every character in
> the read-in string against string.printable but that will take a long
> time.

Well, probably not really. Consider that CPU speeds dramatically 
outperform network transport speeds such that by the time your local 
performance becomes an issue, you've got a _huge_ xmlrpc argument to 
pass over the wire...

Emile




More information about the Python-list mailing list