Skip to main content

Python

2026


TWIL 21 2026

·5 mins
In the previous TWIL, we’ve learned about Thermal printers, their components, communication interfaces & Command language. In this TWIL, we’ll try to communicate with one Label Printer using its command language which is TSPL. Talking to a thermal printer using TSPL #In the previous TWIL, I explored how thermal printers work internally, identified my printer, and successfully established a Bluetooth connection to it using Python.

2025


Decorators design pattern

·5 mins
In software development, we often need to add extra behavior to existing functions without changing their original code. Common examples include logging, authentication, validation, caching, and performance tracking. A beginner solution is usually copying the same logic into multiple functions. While this works at first, it quickly creates repeated code, cluttered functions, and maintenance problems. This is where the Decorator Pattern becomes useful. What is the Decorator Pattern? #The Decorator Pattern is a structural design pattern that allows developers to dynamically add new behavior to existing objects or functions without modifying their original implementation.