Created
June 15, 2013 04:12
-
-
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
This file contains 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
#!/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