Created
November 22, 2016 15:18
-
-
Save vrde/e85a66a172679020eb16643b579aa305 to your computer and use it in GitHub Desktop.
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
from random import shuffle | |
# format of the file | |
# name email\nname email\nname email... | |
people = open('people.txt').read().split('\n')[:-1] | |
shuffle(people) | |
TMPL = """Dear {}, | |
I'm inviting you to a fun game of Secret Santa. Secret Santa is a fun game in which everyone buys gifts for one other person, who doesn't know who bought their gift. | |
The person you have to buy a gift for is {}. The budget for this year is 15€. | |
We will be exchanging gifts at our Christmas Party, on December 1st. | |
See ya there! | |
Secret Santa's helper Malicious Carly | |
""" | |
for giver, receiver in zip(people, people[1:] + people[:1]): | |
giver_name, giver_email = giver.split(' ') | |
receiver_name, _ = receiver.split(' ') | |
print(giver_email) | |
print() | |
print(TMPL.format(giver_name, receiver_name)) | |
print() | |
print('=' * 40) | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment