Trey Hunner
@trey.io
Python & Django team trainer
I help folks sharpen their Python skills with https://PythonMorsels.com 🐍🍪
YIMBY. 95% vegan.
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.
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
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.
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.
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
When you type code into the Python REPL, it will be colorized as you type it.
Read more �‘‰ https://trey.io/flfwr9
#Python
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
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
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
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
This is such a weird email to get from the Social Security Administration... 🙁
July 4, 2025 at 7:05 PM
This is such a weird email to get from the Social Security Administration... 🙁
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
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
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
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
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
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
Enjoyed this morning's #PyConUS keynote from @tfmfm.bsky.social & @geoffhing.bsky.social on a very important use for #Python.
is.gd/tmppyconus
is.gd/tmppyconus
May 18, 2025 at 2:11 PM
Enjoyed this morning's #PyConUS keynote from @tfmfm.bsky.social & @geoffhing.bsky.social on a very important use for #Python.
is.gd/tmppyconus
is.gd/tmppyconus
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. 🐍🍪
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
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. 🐍🍪
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 12:29 AM
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! 🐍🍪😅
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
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! 🐍🍪😅
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! 🐍🍪😅
"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
#EarthDay
April 22, 2025 at 10:53 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
#EarthDay
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. 🤔
It used over 22,000 tokens just thinking about a response. 🤔
February 7, 2025 at 12:03 AM
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. 🤔
It used over 22,000 tokens just thinking about a response. 🤔
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
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
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
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
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...
>>> 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
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...
>>> 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...
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 💜
"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
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 💜
"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 💜