Skip to content

Instantly share code, notes, and snippets.

@jaklinger
Created April 23, 2021 10:34
Show Gist options
  • Save jaklinger/bea48792a0b4c82276e63c9e8b60a15a to your computer and use it in GitHub Desktop.
Save jaklinger/bea48792a0b4c82276e63c9e8b60a15a to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
import time
from functools import lru_cache
WINNER_TEXT = "The winner is"
@lru_cache()
def get_data():
data = pd.read_excel("ProFinda Registration Drive (Responses).xlsx").to_dict(orient="records")
np.random.shuffle(data)
return iter(data)
def select_winner():
data = get_data()
winner = next(data)
print()
print(WINNER_TEXT, end="\r")
for i in range(3):
time.sleep(1)
print(WINNER_TEXT + (i+1)*".", end="\r")
time.sleep(1)
print(WINNER_TEXT + " *** Drumroll 🥁 ***\n")
time.sleep(2)
print("⭐ 🌟", winner['Full Name '], "... with charity ...", winner["Charity name "], "🌟 ⭐")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment