Skip to content

Instantly share code, notes, and snippets.

@swinton
Created September 17, 2013 19:16
Show Gist options
  • Select an option

  • Save swinton/6599307 to your computer and use it in GitHub Desktop.

Select an option

Save swinton/6599307 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
"""
Slugify input from STDIN to STDOUT.
Usage:
$ slugify.py
one two three four five
ctrl+D
one-two-three-four-five
"""
import sys
from django.template.defaultfilters import slugify
print slugify(sys.stdin.readline())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment