Skip to content

Instantly share code, notes, and snippets.

@draringi
Created June 15, 2013 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save draringi/5786864 to your computer and use it in GitHub Desktop.
Save draringi/5786864 to your computer and use it in GitHub Desktop.
Hash tagger: A simple python script for turning a standard string into a string of hashtagged terms
#!/usr/bin/python2
import re, sys, argparse
parser=argparse.ArgumentParser(description='Turns a normal string into a string of hashtagged terms.')
parser.add_argument('string', metavar = 'TEXT')
args = parser.parse_args()
words = re.findall(r"\w+",args.string)
for word in words:
sys.stdout.write("#"+word+" ")
sys.stdout.write("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment