Created
April 10, 2017 03:47
-
-
Save footballqq/2a5b26e00b9bf93d27883fc9fd65f8bf to your computer and use it in GitHub Desktop.
remove non printable chars and non filename chars from string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileName = re.sub('[^\w\s-]', '.', fileName).strip().lower() | |
#will replace non printable chars to "." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment