Writing to an InfluxDB server with Python3

A quick GitHub gist for anyone looking to write to an InfluxDB server with Python3. This is a generic function that accepts three inputs; as an example, I am using temperature data in degrees Celsius. Turning DHT11 readings into beautiful graphs in Grafana Once you have your data in influxDB, a great way to visualise it is using Grafana. I hope to bring you more posts in the future about visualising your python data with Grafana....

January 19, 2021 · 1 min · Tom

Debian 10 - How to upgrade python 3.7 to python 3.9

I have covered this a number of times in the past and the posts have proved popular and useful to many. So, here is my guide for updating to the latest version of Python 3 (3.9) on Debian 10 Buster. To clarify the purpose of this guide, Debian 10 ships with Python 2 (2.7) and Python 3 (3.7) installed at my time of writing. For those wishing to upgrade from python 3....

January 5, 2021 · 3 min · Tom

Calculating compound interest with Python 3

Compound stonks only go up! I have a growing interest in finance and analytics, so it felt like a great idea to start creating my own set of financial tools with Python. This article will explain how I created a simple but effective script for calculating compound interest with Python. I wrote this in Python 3 (as all new Python projects should be from now onwards), but the library dependencies are very lightweight, making this something that could easily be re-written from Python 2....

January 3, 2021 · 3 min · Tom

How To call a bash command with variables in Python

A quick Google of the above only seemed to give me answers for the inverse, calling a python script from a bash shell and handing it variables. At least, the first 3 results showed this and I’m probably not alone when it comes to scrolling down past the StackOverflow articles. So I am had to go it alone and the way that I figured out how to call a bash command with variables in Python (3), is a total hack… But it works....

December 28, 2020 · 3 min · Tom

How To: Python infinite loops with while true

Here is a quick guide on how to create an infinite loop in python using a ‘while true’ statement. There are number of reason that you might want to implement this; a great use case would be outputting a fluctuating variable to the terminal such as a temperature reading from a sensor. loops that make your brain hurt A ‘while true’ statement allows us to run a sequence of code until a particular condition is met....

May 5, 2020 · 2 min · Tom