Python’s decorators with arguments

We have talked about decorators in python in this post. Now we will see how to use arguments into the decorators.

This is an example

The output

Example nr. 2

A little more “sophisticated” usage of the decorator with more metadata of the functions using the decorators. In this case the decorator is used to explain what are the input and the output of the functions and how the function gets from the result.

The output:

 

Post written by Avatar A python enthusiast

Pygame map editor devlog

The devlog of the Pygame map editor. A work in progress to create a map editor to create maps with tiles with an example of a game that uses these maps. The current version is 1.5 of the map editor and 0.2 of the game, not yet ready for the 1.5 version of the editor (16.9.2020). Repository of the map editor