Created
December 26, 2012 05:12
-
-
Save justinwoo/4378070 to your computer and use it in GitHub Desktop.
this script will [le]terally give you brain cancer. This script takes what you have in your clipboard and "le transforms" it into moron-speak. e.g. the quick little brown fox jumps over the lazy dog -> le quick [le]ttle brown fox jumps ov[l]er le lazy dog. Use wisely and not in the presence of children.
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
#aka brain cancer | |
import win32clipboard as clippy | |
def main(): | |
#gotta do this for clip board stuff | |
clippy.OpenClipboard() | |
cliptext = clippy.GetClipboardData() | |
outtext = '' | |
ctr = 1 | |
for word in cliptext.split('e'): | |
#replace 'el' with 'le', 'li' with '[le]'' | |
word = word.replace('el','le') | |
word = word.replace('li','[le]') | |
#replace 'e' with '[l]e' but 'th' with 'le' | |
if ctr != len(cliptext.split('e')): | |
if word[-1] == 'h' and word[-2] == 't': | |
word = word[:-2] + 'l' | |
elif word[-1] != 'l': | |
word = word + '[l]' | |
outtext += word + 'e' | |
ctr += 1 | |
outtext = outtext[:-1] | |
#set the clipboard | |
clippy.EmptyClipboard() | |
clippy.SetClipboardText(outtext) | |
clippy.CloseClipboard() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment