Python has filter method which filters the desired output on some criteria as like in the following example.
>>> s = "some\x00string. with\x15 funny characters"
>>> import string
>>> printable = set(string.printable)
>>> filter(lambda x: x in printable, s)
'somestring. with funny characters'
The example is taken from link. Now, when I am trying to do similar thing in Python IDE it does return the result 'somestring. with funny characters'
infact it return this <filter object at 0x0000020E1792EC50>
. In IDE I cannot use just simple Enter so I am running this whole code with a print when filtering. Where I am doing it wrong? Thanks.