Python coding

last updated: 2020-11-07

For Python coding see also the Python with Raspberry Pi tutorial (in German) or the Buses chapter of the sensors2bus tutorial (in English).

I can't guaranty a faultless project, so using the information is at one's own risk.

My first bigger Python project was a program to generate this website without JavaScript or PHP. Python is a really cool programming language and especially with modules like TKinter (GUI), NumPy, Pandas, Matplotlib or OpenCV. So here I will document some of my Python projects.

PYthon Simple HomePage CREATOR

PYthon Simple HomePage CREATOR

I like a website without JavaScript or PHP. But to add new pages to my site took too much time. So I wrote a little Python program to simplify the task. For my pages I use Markdown which gives a very readable file, and helps to focus on the content.

The structure of the homepage is given by the directory tree. The names of the directories are also the names and links in menu and sidebar. A simple configuration file allows to change CSS properties like the font-size or background colour.

OpenCV basics

As a reminder I will document here simple code snippets and functions of OpenCV.

Read an analogue gauge with OpenCV

I needed a program to read pointer-type dials on an analogue gauge. To read the two pointers I used python 3 and opencv. Here you see the result:

first pointer    second pointer

gauge_p2.jpg We are reading: 497.1153 ┬Ám