How I set up and work with this website

Posted on Sat 03 August 2019 in Python • Tagged with Python, Pelican, This website, CircleCI, Netlify • 6 min read

In this article I will go through how I set up this website. What my workflow looks like, updating content and configurations. Also how I set up a staging environment and a production environment with automatic builds and deployment. And how I can do almost anything from any of my …


Continue reading

Pieces of Py #2: Use a dictionary instead of multiple if-statements

Posted on Thu 01 August 2019 in Python • Tagged with Python, Pieces of Py, Dictionary, Lambda, Functools • 4 min read

One thing I learned during my first #100DaysOfCode was to use a dict instead of numerous if-statements. In my opinion it can make the code much more readable among other things. Here I'll try to make an example where this concept could fit in.

In this example we create a …


Continue reading

Pieces of Py #1: Decorator with arguments

Posted on Tue 09 July 2019 in Python • Tagged with Python, Pieces of Py, Decorator • 3 min read

This post is a simple example which explains how to create a decorator function that accepts and uses argument(s). A decorator that would accept an argument could look like this:

@mydecorator(my_argument)
def my_decorated_function(input):
    return input

A simple scenario could be that you would like to print something …


Continue reading