Trey Hunner
banner
trey.io
Trey Hunner
@trey.io
Python & Django team trainer

I help folks sharpen their Python skills with https://PythonMorsels.com 🐍🍪

YIMBY. 95% vegan.
Increased diversity in communities usually comes from active outreach work. PyCon's has a partially blinded talk selection processes.

If 300 people submit talks and 294 are men, then 98% of talks will likely be from men.

If 500 people submit talks and 394 are men, then ~79% will likely be by men.
October 27, 2025 at 10:02 PM
When you type code into the Python REPL, it will be colorized as you type it. Read more �‘‰ https://trey.io/flfwr9 #Python
October 23, 2025 at 7:19 PM
So when writing a file using Python's csv module, you're expected to always specify newline="" when opening the file you're writing to, to make sure that you don't accidentally double up your carriage returns on Windows. Read more �‘‰ https://trey.io/ca0qyn #Python
October 14, 2025 at 4:17 PM
In the 1960s, teleprinters used a carriage return (CR) to move the printhead back to the beginning of the line, and they used a line feed (LF) to move to the next line. Read more �‘‰ https://trey.io/ca0qyn #Python
August 14, 2025 at 12:14 AM
This is such a weird email to get from the Social Security Administration... 🙁
July 4, 2025 at 7:05 PM
But PEP8 (the official Python style guide) recommends putting binary operators (operators that go in between two values, like and and or) at the beginning of each line, for the sake of readability. Read more �‘‰ https://trey.io/f98u5c #Python
July 1, 2025 at 11:03 PM
Working with file paths in Python? (splitting, joining, navigating, etc.)

Check out #Python's pathlib module.

It's great for splitting/joining paths, finding files by filename patterns, renaming files, and more.

pym.dev/pathlib-module
July 1, 2025 at 6:04 PM
I decided to just quote the oath of office on mine. #NoKings
June 14, 2025 at 3:57 PM
Enjoyed this morning's #PyConUS keynote from @tfmfm.bsky.social & @geoffhing.bsky.social on a very important use for #Python.

is.gd/tmppyconus
May 18, 2025 at 2:11 PM
Hello #PyConUS attendee who I have probably never met!

If you would like to say hello, please message me while we're both in the same city together! I'm on Signal at trey.02. More contact details at trey.io/pycon

Also I have Python Morsels stickers! I'd love to give you one. 🐍🍪
May 16, 2025 at 7:52 PM
When chatting in the hallway at PyCon, try leaving a gap for someone else to join the conversation. #PyConUS
May 16, 2025 at 1:40 PM
We're playing Cabo and other games in the Westin lobby.

Come join us #PyConUS folks!
May 16, 2025 at 12:29 AM
Don't miss out on the rooftop track at #PyConUS this year! 🌳

There are a couple dozen of us out here eating lunch right now and I many folks will be hanging out here over the next few days of @pycon.us.

The rooftop track is like the hallway track, but with a great view! 🖼️
May 15, 2025 at 5:21 PM
Hey #NBPy folks! 👋

I'm flying out tonight, so if you would like a Python Morsels sticker, hug, or a chat, find me today.

I would love to say hey to you if we haven't met yet!

If you would like a Python Morsels sticker today PLEASE ask me for one (or 10!). I brought so many! 🐍🍪😅
April 27, 2025 at 4:35 PM
"There is perhaps no better demonstration of the folly of human conceits than this distant image of our tiny world. To me, it underscores our responsibility to deal more kindly with one another, and to preserve and cherish the pale blue dot, the only home we've ever known." -Carl Sagan

#EarthDay
April 22, 2025 at 10:53 PM
Well that was weird... DeepSeek R1 just thought for almost 8 minutes before starting to give me a response. 🤯

It used over 22,000 tokens just thinking about a response. 🤔
February 7, 2025 at 12:03 AM
Each day, you'll watch a 4 minute video and then attempt to write Python code. ⌨

It's 2 hours of video, but about 20 hours of carefully crafted bite-sized exercises. 🍪

I just launched this course and it's 50% off, but only through Monday. 💸

https://pym.dev/courses/jumpstart/overview
November 30, 2024 at 7:04 PM
Comprehensions have their own scope:

>>> n = 4
>>> squares = [n**2 for n in range(9)]
>>> n
4

But loops do NOT have their own scope:

>>> n = 4
>>> for n in squares: ...
>>> n
81

This looks like a #PythonOddity, but there's a good reason. #Python

trey.io/function-sco...
November 20, 2024 at 5:58 PM
This photo was captured 33 rotations ago today, 6 million km from the sun.

"There is perhaps no better demonstration of the folly of human conceits than this distant image of our tiny world." —Carl Sagan

Sagan's full quote from the Cosmos series: youtu.be/GO5FwsblpT8?...

Happy #PaleBlueDot Day 💜
February 14, 2024 at 6:40 PM