Created
August 15, 2017 15:42
-
-
Save octaflop/1fed3267b53375d109eefc0931f29ad0 to your computer and use it in GitHub Desktop.
Creates randomly capitalized text for spongebob memes.
This file contains hidden or 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/python | |
""" | |
This stupid function produces randomly capitalized text for usage in the | |
god-awful spongebob meme. | |
I can't believe I've done this. | |
""" | |
import random | |
try: | |
import click | |
except ImportError: | |
print("Please `pip install Click` into your environment to continue!") | |
@click.command() | |
@click.option('--text', prompt='Text to spongify') | |
def spongify(text): | |
newtext = '' | |
for t in text: | |
r = random.randint(0, 1) | |
if r == 1: | |
newtext += t.upper() | |
else: | |
newtext += t.lower() | |
click.echo(newtext) | |
if __name__ == "__main__": | |
spongify() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment