5th

12:56: When you need to sort a list by a specific key in each list-item’s object, you use a lambda function to drill down to your key.1

example = [
	("event": "A walk in the woods", "date": datetime_object_1),
	("event": "Grocery Shopping", "date": datetime_object_2),
	("event": "Movie Night")
]

example.sort(key=lambda example: example["date"])

25th

21:55: For when you develop a Python script on one machine, then place it for running on another, but you didn’t generate a requirements.txt file - pipreqs1 will interrogate the import statements in all python files in the directory you specify and generate a requirements.txt file based on those import statements. Then you can pip install -r requirements.txt to make sure all your script’s requirements are met. Boom.

Refs:

8th

10:30: I’m always needing and never remembering that dict(zip(keys, values)) is a thing. Dict keys in keys, dict values in values, and boom! now both are combined as a single dictionary. Note that keys and values must be equal in length.