Using the curses library to view IoT data

Old School

© Lead Image © Andrey Kiselev, 123RF.com

© Lead Image © Andrey Kiselev, 123RF.com

Author(s):

When you need some quick graphical output, the old school curses library can save you some time and effort.

Many projects require a lot of time building colorful web pages or custom graphical user interfaces (GUIs). In a number of cases, however, only a simple text interface is required, especially for remote connections into a Raspberry Pi when you just want a quick system update.

In this article, I review a 1980s technology called curses [1], which lets you create text-based applications without requiring X windows or web services. In one example I look at C and Python apps that simulate Raspberry Pi sensor data, and in two examples, I output large text presentations and dynamic bars in Python [2].

Python Curses

The curses module is standard in Python and includes features such as:

[...]