Skip to content

Instantly share code, notes, and snippets.

@jvanmelckebeke
Forked from SeppeSoete/rcase.py
Last active May 29, 2020 10:03
Show Gist options
  • Save jvanmelckebeke/d0e1cbbbf0a1ba2aae45d89699b12e2f to your computer and use it in GitHub Desktop.
Save jvanmelckebeke/d0e1cbbbf0a1ba2aae45d89699b12e2f to your computer and use it in GitHub Desktop.
#!/bin/python3
from random import getrandbits as bitrandie
import sys
import pyperclip
b = bool(bitrandie(1))
def getword(word):
global b
for letter in word:
yield letter.upper() if b else letter.lower()
b = not b
words = sys.argv[1:]
result = " ".join("".join(getword(word)) for word in words)
print(result)
pyperclip.copy(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment