I want to make a file including non-printable characters to just only include printable characters. I think this problem is related to ACSCII control action, but I could not
Minimalistic solution comes to my mind is
import string printable_string = filter(lambda x: x in string.printable, your_string) ## TODO: substitute your string in the place of "your_string"
If still this doesn't help then try also including uni-code specific [curses.ascii]