Created
September 7, 2013 11:55
-
-
Save nmcv/6474977 to your computer and use it in GitHub Desktop.
Simple python script to convert stdin to 13375p34k with limited dictionary
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/env python | |
''' Simple Python script to convert STDIN to 13375p34k with limited dictionary ''' | |
''' | |
Usage: | |
$ chmod +x leet_speak.py | |
$ echo "All your base are belong to us" | leet_speak.py | |
''' | |
import sys | |
from string import maketrans, translate | |
fromAlphabet = "letsa" | |
toAlphabet = "13754" | |
try: | |
translatable = sys.stdin.read() | |
table = maketrans(fromAlphabet, toAlphabet) | |
print(translate(translatable, table)) | |
except: | |
sys.stderr.write('No input') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment