Some time ago I asked on Twitter: I was curious what you use #Python decorators for? And I got quite an amazing / insightful response: The obvious next step for me was to look at some examples / use cases. So below are 5 useful applications of decorators. Study them, then apply similar things to… Continue reading 5 Helpful Python Decorator Use Cases
Articles on logging
10 Cool Pytest Tips You Might Not Know About
By Bob Belderbos on 26 February 2021
Here are 10 things we learned writing pytest code that might come in handy.
Learning Python Decorators by Example
By Bob Belderbos on 20 October 2017
Decorators are a sometimes overlooked feature and they might be hard to grasp for beginning Pythonistas. I agree with Aaron Maxwell that mastering them “can massively magnify the positive impact of the code you write”, so make sure you add them to your toolkit if not done so already. In this article I explain what they do, why you want to use them and give some practical examples.
Building a Karma Bot with Python and the Slack API
By Bob Belderbos on 25 June 2017
We love Slack! But what if we can make it even cooler? Imagine: you are geeking out with your fellow developers on Slack and you want to give them credit. Or you can write “stupidsubject–” and it automagically shows “stupidsubject’s karma decreased to -2”. Enter Karma Bot. This is nothing new but building one myself was a great learning exercise and a fun tool we use on our Slack now.
How to Write a Simple Slack Bot to Monitor Your Brand on Twitter
By Bob Belderbos on 25 April 2017
In this article I show you how to monitor Twitter and post alerts to a Slack channel. We built a nice tool to monitor whenever our domain gets mentioned on Twitter. The slacker and twython modules made this pretty easy. We also use configparser and logging.
How we Automated our 100DaysOfCode Daily Tweet
By Bob Belderbos on 5 April 2017
In this article I show you a way to automatically tweet your #100DaysOfCode Challenge progress. This saves you some extra time to focus on the coding. Isn’t that all what matters?
Automate Tweeting: how to build a Twitterbot
By Bob Belderbos on 29 December 2016
In this post I will show you how we automate part of our Twitter posting using feedparser and tweepy.
Learning from Python mistakes
By Bob Belderbos on 28 December 2016
In this post I summarize some great lessons Mike Pirnat shared in his free ebook ‘How to make mistakes in Python’