A snake with no name – Lambdas in Python (also functions and list comprehensions)

A snake with no name – Lambdas in Python (also functions and list comprehensions)

Sweet and short: Instead of a function you can write a single statement in Python as a lambda. Either is one either better or worse nor does one replace the other. They both have their place and intended use. Functions hopefully have describing names, are probably used multiple times and handle a specific part which…

“You won’t get IN with THIS E-Mail” – Python Regex to validate email (formally)

“You won’t get IN with THIS E-Mail” – Python Regex to validate email (formally)

Currently did some text analysis with Python and Regex. Came up with an E-Mail format validation method which could help you with the same problem and remind me of it in the future. Import package re and use the compile method to get a regex pattern with which you can match your desired String.For evaluation…

It was born like this – pre-enabling WiFi and SSH on Raspberry Pi OS and creating a user

It was born like this – pre-enabling WiFi and SSH on Raspberry Pi OS and creating a user

Most of my Raspberry Pis run headless (just remote console, no GUI). To remind myself and for your service I wrote this short memo how to set them up correctly. You can also find the same and much more Pi related information here, but I like to keep the stuff I need together in one…

Knock-knock- a door or window sensor prototype in (Micro)Python on the Pico, D1 mini and Pi Zero

Knock-knock- a door or window sensor prototype in (Micro)Python on the Pico, D1 mini and Pi Zero

Jump to: Pico – D1 mini – Pi Zero Raspberry Pico A short Python implementation of a magnetic switch turning on a LED when it is not connected (e.g. window is opened). For simplicity reasons I used the builtin LED on the Pico. You have to use the pull=Pin.PULL_DOWN parameter for the input pin (sensor)….

Gordon knows how: Flashing Micropython on D1 mini and D1 mini lite

Gordon knows how: Flashing Micropython on D1 mini and D1 mini lite

As I really prefer Python for my little projects over C++, I flashed my Wemos boards with Micropython and wanted to share how I did it (it was pretty easy). You have to connect your board with USB to your computer, have Thonny installed and the desired micropython image downloaded. (You can do it with…

Dusting off the blood sucker – deleting sustained mosquitto messages

Dusting off the blood sucker – deleting sustained mosquitto messages

After expermienting alot with my MQTT server it was pretty polluted with sustained messages and I wanted to get rid of them. The fastest way I got this reliably to work was by deleting the persistence file while the MQTT server was offline. You could delete all or specific topics with a script, too, but…

Enter the Matrix – UNICORN style (a.k.a. a Matrix scroller in MicroPython on the Pimoroni PicoUnicorn Hat)

Enter the Matrix – UNICORN style (a.k.a. a Matrix scroller in MicroPython on the Pimoroni PicoUnicorn Hat)

As a software engineer I often write code that runs (hopefully) fine in the background, does its job and you probably never see it again. That dragged me to buy a unicorn hat for my first Raspberry Pico, as I’d like to see some fancy output of my spare time project. After some time of…

It’s about time – how to auto-run your Python scripts on Raspberry Pi OS with Cron jobs

It’s about time – how to auto-run your Python scripts on Raspberry Pi OS with Cron jobs

This is a step by step reminder how to get your Python scripts run automatically on your Raspberry. We will be creating a cron job that is run once when booting. (This should be possible like this or pretty similar on every Linux distribution where Cron is available and is not limited to Python scripts…