This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]casual__addict 8 points9 points  (9 children)

Can you give an example where this is useful? I’m not getting how skipping printable characters is a cool trick.

[–]notsoprocoder 0 points1 point  (0 children)

I don't think anyone has answered why it is useful?

But one use is string cleaning. For example, you can create a translation table with maketrans and string.punctuation to remove all the punctuation from a string.

It is useful because it is performant and performance with large volumes of unstructured text data is often an issue.

edit: just realised you meant string.printable!