Skip to content

Instantly share code, notes, and snippets.

@nmcv
Created September 7, 2013 11:55
Show Gist options
  • Save nmcv/6474977 to your computer and use it in GitHub Desktop.
Save nmcv/6474977 to your computer and use it in GitHub Desktop.
Simple python script to convert stdin to 13375p34k with limited dictionary
#!/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