Skip to content

Instantly share code, notes, and snippets.

@jupiterbjy
Created July 11, 2024 03:08
Show Gist options
  • Save jupiterbjy/9479cc8811680277e387ba8339cdf693 to your computer and use it in GitHub Desktop.
Save jupiterbjy/9479cc8811680277e387ba8339cdf693 to your computer and use it in GitHub Desktop.
Some generic pseudo random tool
"""
Pseudo Random Picker from CSV input
:Author: jupiterbjy@gmail.com
"""
import random
YELLOW = "\033[93m"
GREEN = "\033[92m"
RED = "\033[91m"
while True:
raw_input = input(f"{YELLOW}Choices (CSV) >> \33[0m").strip()
# if empty don't bother
if not raw_input:
print(f"{GREEN}\33[3mSaint Pseudorandom once said... \"Mah boy! You musn't hesitate...\"\n")
continue
raw_split = [part.strip() for part in raw_input.split(",")]
choice = random.choice(raw_split)
# 0: reset / 3: italic / 4: underline / 5: slow blink
print(f"{GREEN}\33[3mSaint Pseudorandom once said... \"Tho shall be {RED}\33[4m{choice}\33[0;3m{GREEN}\"\n")
@jupiterbjy
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment