Some version of this should fix the problem:
filtered_string = filter(lambda x: x in string.printable, myStr)
via