Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README.md

giftcircle.py

Holiday Python geekiness…

If your family (or classroom or workplace) does “gift circles,” where everyone buys a gift for exactly one other person in the group, you could do (and probably already do) do the old “pull a name out of a hat” thing. But that takes setup: writing down names, cutting them out, finding a hat, passing it around... shouldn’t this process be automated? Here’s a little Python script to get it done quick.

On my MacBook, the script runs for ten people in 27 milliseconds – think of all the egg you could nog in the time you save!

Populate the “recipients” list with real names and run python /path/to/giftcircle.py.

Output looks like:

1: Leslie gives to Amy
2: Jamie gives to Leslie
3: Avis gives to Momo
4: Jim gives to Jamie
5: Amy gives to Buford
6: Scot gives to Mike
7: Mike gives to Scot
8: Miles gives to Avis
9: Buford gives to Jim
10: Momo gives to Miles

Happy holidays, you big nerd!

About

Holiday Python geekiness…

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.