- 20250301
- Updated script to choose between two movie options.
- 20250110
- Added Movies Watched section at bottom.
March 16, 2024 at 22:12
Last Updated: 01 March 2025 - Now picks between two movie options
I have a really simple one today. The script below will pick two options from a list of movies and message you when it’s time for Movie Night.
My kids are siblings. They argue. When my son doesn’t get his way, he’ll find a loophole or negotiate until he’s blue in the face, then tantrum walk away if there’s no hope. My daughter, on the other hand, will switch to 100% silent mode and quietly and slowly walk away if someone doesn’t offer her the win. You know, typical kid bullshit.
Python has surprisingly helped calm these issues since I’ve convinced my kids that the computer is an impartial, unfeeling robot monster. So, no matter what the robot picks, it’s not because it doesn’t want you to win. It’s because it doesn’t care which kid it eats first. It’s important as a parent to instill a healthy respect and fear for technology. How else will we stand a chance in the AI wars of 2027?
So, here’s how it’s done:
movies.py
import random
#from slack_lib import send_message_to_slack
with open('/movie_bot/movies.txt', 'r') as file:
movies = [line.strip() for line in file]
if len(movies) < 2:
raise ValueError("Not enough movies left on the list.")
choices = random.sample(movies, 2)
message = f"> Tonight's Movies:\n• Option 1: {choices[0]}\n• Option 2: {choices[1]}"
print(message)
#send_message_to_slack(message, username="🍿 Movie Bot 🎞️")
Set this script to run at certain times or run it manually. Enjoy the movie. Knock it off the list. Simple.
Questions or comments?