grep is your friend
MP 153: If it's not already, it should be. :) Note: I will get back to the debugging series as soon as I can. Work has been busy lately, and it's much easier to write about things that are coming up in my regular work at the
MP 153: If it's not already, it should be. :) Note: I will get back to the debugging series as soon as I can. Work has been busy lately, and it's much easier to write about things that are coming up in my regular work at the
MP 152: But the timedelta implementation in Python is correct. In many projects, timestamps are just a bit of metadata you might look at once in a while when troubleshooting. But sometimes, timestamps are a critical piece of information. If you handle them right, your project works. If you don&
MP 151: How do you debug a program that doesn't crash? In the last two posts we made models called Card, Hand, and Deck, which can form the foundation of any game that uses playing cards. In this post we'll start building a terminal-based implementation of
MP 150: Modeling a hand of playing cards, and a deck as well. Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will be available to
MP 149: In pursuit of logical errors. Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will be available to everyone. Thank you to everyone who
MP 148: How small can a minimum reproducible example be? Note: My workload has increased over the last month, and I haven't had time to finish the current debugging series. It should be wrapped up in a few more posts, and those posts should come out over the
MP 147: How do you clean up when you have too many Pythons lying around? About a year and a half ago, I wrote a post about how to update the version of Python you're using locally. I was hoping that would be a guide I could refer
MP 146: What happens when the bug actually is in one of your project's dependencies? Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they
MP 145: Why third-party code appears in tracebacks, and what you can learn from it. Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will be
MP 144: What happens when you fix a bug, only to find another bug right away? Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will
MP 143: How do you find a bug in a larger project? Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will be available to everyone.
MP 142: Conference "open spaces" are a great place to get valuable feedback about new projects. Note: The debugging series will continue shortly. I spent a full week at PyCon, and my son graduated from middle school the day after I got back. Life has been busy. :) I
MP 141: Advice from a climbing guide that's quite relevant to programming. Note: The debugging series will continue shortly. I'm busy getting ready for PyCon, and haven't had time to finish the next post in that series yet. Since moving to North Carolina last
MP 140: How can we take a systematic approach to a "simple" bug? Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will be
MP 139: A systematic, inquisitive approach makes debugging simple issues easier, and complex bugs possible. Note: This post is part of an ongoing series about debugging in Python. The posts in this series will only be available to paid subscribers for the first 6 weeks. After that they will be
MP 138: Debugging is often learned "on the job", but you can learn a lot with structured practice. Note: This is the first post in a series about debugging. This post is free to everyone, but the remainder of the series will be available to paid subscribers only
real-world projects
MP 137: I just learned about the webbrowser module; maybe it can save you some work as well. Note: I'll start a new series about debugging on Thursday, April 3. The series will cover a variety of debugging tools and techniques, and will also offer a focused way
MP 136: I don't use it often, but I keep coming back to it. The walrus operator was introduced in Python 3.8, back in 2019. I haven't used it often over the last five years, but occasionally I find myself writing some code that looks
reflections
MP 135: They're focused on .gov right now, but I'm pretty sure they're coming for all of us. I can't believe I have to use the name DOGE seriously. When I first heard a new government organization would be formed with that
optimization
MP 134: Be careful about performance assumptions until you measure them! Note: In the next few weeks, I'm going to slow the pace slightly on Mostly Python. I've been writing at least one post per week for two full years now. I really enjoy writing these
refactoring
MP 133: Naming things is hard, but renaming things can be even harder. I've been steadily working through the remaining issues that should be closed before the 1.0 release of django-simple-deploy. One of the last things to address involves reconsidering a name that's used throughout
refactoring
MP 132: It's a simple built-in function, but using it isn't as straightforward as it might seem. A task that's come up repeatedly in my programming work involves looking through a collection of values, and taking an action if a specific item appears anywhere
Git
MP 131: It seems like Git is always more capable than I realized. I've been using Git for almost 20 years now, and I still discover new ways to use it more effectively. I really appreciate a tool that has more to offer every time I use a
real-world projects
MP 130: How do you make a reasonably secure access code for an electronic door lock? We recently moved into a new house, and one of the first tasks after moving in is to change the locks. Rather than just rekey the existing locks, we decided to install electronic locks.
reflections
MP 129: Highlights from 2024, and what's to come in 2025. I've been writing Mostly Python for two full years now. I started it in order to write more regularly about Python, and about a wide range of topics from the perspective of a Python user
real-world projects
MP 128: Sometimes a try-except block isn't the best approach for handling missing attributes. In Python it's often reasonable to try doing something, and then respond appropriately if that action doesn't work. This is the "ask for forgiveness rather than asking for permission&
Git
MP 127: How do you make sure you've cleaned up all your diagnostic code? I've been doing a bunch of refactoring work on a moderately sized project recently. I'm always looking for ways to work more efficiently, and use tools like Git better. It&
GitHub
MP 126: How do you make a GitHub task list for reviewing all functions in a file? I've been steadily working on bringing django-simple-deploy to a 1.0 release, and this has involved a lot of refactoring. At some stages of development, I want to do a quick
reflections
MP 125: I would argue it was discovered, and that's a helpful distinction. There's no doubt that regardless of anyone's opinion about whether AI is useful or not, it's disrupting many industries, and will continue to do so. The distinction between invention
Selenium
MP 124: It should be simple to do, right? We're in the process of buying a house at the moment, and we want to keep a copy of the pictures on Zillow that show how the house is currently set up. Lots of people want to do this,
real-world projects
MP 123: Modeling mortgage loans, to help make clearer financial decisions. We're in the process of buying a house, and whenever we go through this process I spend a lot of time looking at all the different options about taking out such a significant loan. I always do
reflections
MP 122: And why I like them so much. Something people new to Python don't always understand well is the role of "third party" packages in the ecosystem. People learn the basics of Python, and then they want to do something that requires functionality that'