Skip to content

Instantly share code, notes, and snippets.

@minstrel271
Created March 11, 2016 08:40
Show Gist options
  • Save minstrel271/6d4caf995796059aec0a to your computer and use it in GitHub Desktop.
Save minstrel271/6d4caf995796059aec0a to your computer and use it in GitHub Desktop.
from string import ascii_letters, digits
def checker(c, good=set('-_.() '+ascii_letters+digits)):
return c in good
def valid_filename(filename):
return ''.join(filter(checker, filename)).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment