967 B
967 B
Secret Santa
Simple python3 script for the "Secret Santa" game. Creates participants pairs from input json file and prints and saves them to the output json file.
This small script might evolve into a simple website, API or bash script in the future!
Run:
- Create
participants.jsonfile as in the example - Run the next command in your shell (from the same directory as the
main.pyfile):
python3 main.py
- Enjoy script results!
Examples:
- Input file (
participants.json):
[
"Jayce",
"Viktor",
"Jinx",
"Vi",
"Ekko",
"Caitlyn"
]
- Output file (
pairs.json):
{
"Jayce": "Vi",
"Vi": "Viktor",
"Viktor": "Caitlyn",
"Caitlyn": "Jinx",
"Jinx": "Ekko",
"Ekko": "Jayce"
}
- Console output:
Reading from participants.json.
Writing to pairs.json.
Finished!
Results:
Jayce → Vi
Vi → Viktor
Viktor → Caitlyn
Caitlyn → Jinx
Jinx → Ekko
Ekko → Jayce