A few examples that will save the day probably* 95% of time. *I don’t have the actual data but seriously, I bet you’ll find those tips useful more often than not! Introduction This article was originally posted on Medium. I use f-strings every day. The irony is I also every day end up searching the Web to… Continue reading Python F-String Codes I Use Every Day
Articles on Tips
A Better Place to Put Your Python Virtual Environments
By Ahmed Lemine on 7 March 2024
Virtual environments are vital if you’re developing Python apps or just writing some Python scripts. They allow you to isolate different app requirements to prevent conflicts and keep your global OS environment clean. This is super important for many reasons. The most obvious one is requirements isolation. Let’s say that you’re working on two different… Continue reading A Better Place to Put Your Python Virtual Environments
6 Cool Things You Can Do With The Functools Module
By Bob Belderbos on 21 September 2023
In this article let’s look at the functools Standard Library module and 6 cool things you can do with it (be warned, a lot of decorators are coming your way! 😍) … 1. Cache (“memoize”) things You can use the @cache decorator (formerly called @lru_cache) as a “simple lightweight unbounded function cache”. The classic example is… Continue reading 6 Cool Things You Can Do With The Functools Module
Make Each Line Count, Keeping Things Simple in Python
By Bob Belderbos on 24 August 2023
A challenge in software development is to keep things simple 🤯 For your code to not grow overly complex over time 😱 Simple is better than complex.Complex is better than complicated. Zen of Python 🐍 Simplicity in your code means fewer possibilities for bugs to hide and easier debugging when they do arise 📈 It… Continue reading Make Each Line Count, Keeping Things Simple in Python
The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
By Bob Belderbos on 9 August 2023
Python allows you to use *args and **kwargs in function definitions to accept an arbitrary number of positional and keyword arguments, respectively. Here is a simple example: Different types of function arguments In the above example, the arbitrary_args function is defined to accept any number of positional and keyword arguments using the *args and **kwargs… Continue reading The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
Avoiding Silent Failures in Python: Best Practices for Error Handling
By Bob Belderbos on 7 August 2023
In the world of programming, errors are inevitable. But how we choose to handle these errors can make the difference between a system that is robust and user-friendly and one that is fraught with ambiguous issues 😱 The Zen of Python famously states, “Errors should never pass silently.” This principle emphasizes the importance of addressing… Continue reading Avoiding Silent Failures in Python: Best Practices for Error Handling
Testing membership and empty strings
By J. Ryan Hall on 20 January 2023
I was working on one of the exercises on the Pybites platform (Bite 29) and encountered a situation I didn’t understand. I needed to check a set of inputs to see if they were alphanumeric or not as part of the solution to the exercise. I succeeded in all but one test, but I couldn’t… Continue reading Testing membership and empty strings
How to create a self updating GitHub Readme
By Bob Belderbos on 21 November 2022
It was about time to give my GitHub profile a nice intro so inspired by Simon Willison’s blog post I decided to make an intro Readme that auto-updates. First I made a GitHub repo called bbelderbos, my username. That’s how it works: GitHub defaults to showing the Readme.md of your username’s repo on your profile page.… Continue reading How to create a self updating GitHub Readme
The Importance of Disconnecting as a Developer
By Hugh Tipping on 30 June 2022
You don’t need library to download the scent of honeysuckle. You can hear the music of a chattering creek without a secure connection or authentication. We spend so much time connected to and with our tech and our code that we forget what it feels like to be connected to the world around us, to… Continue reading The Importance of Disconnecting as a Developer
Give It Just Five Minutes
By Hugh Tipping on 1 April 2022
You know those nights when you want to work on writing or your coding project or side gig? You want to grow outside of the confines of a day-to-day job but you feel like the job has taken everything out of you. You get tired. You feel like you’re on the last bar of the… Continue reading Give It Just Five Minutes