Skip to content

Instantly share code, notes, and snippets.

@footballqq
Created April 10, 2017 03:47
Show Gist options
  • Save footballqq/2a5b26e00b9bf93d27883fc9fd65f8bf to your computer and use it in GitHub Desktop.
Save footballqq/2a5b26e00b9bf93d27883fc9fd65f8bf to your computer and use it in GitHub Desktop.
remove non printable chars and non filename chars from string
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