Using the curses library to view IoT data

Old School

© Lead Image © Andrey Kiselev, 123RF.com

© Lead Image © Andrey Kiselev, 123RF.com

Article from Issue 232/2020
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:

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Nerf Target Game

    A cool Nerf gun game for a neighborhood party provides a lesson in Python coding with multiple processors.

  • Perl: Internet Video Organizer

    Video files are ready for download, but your storage space is limited, and, if you're like most people, you may have a hard time letting go of past favorites. You need a higher authority to decide when it’s time to trim down your collection.

  • Serial Communications

    We explore serial communications, from the electrical specs to protocols and libraries, with an example of serial communication with an Arduino.

  • Raspberry Pi Penny Counter

    Get feedback for live events with an exit survey that counts pennies.

  • Perl: Dynamic netstat

    The netstat utility reveals how your Linux box interacts with the local network. With a few Perl modules, you can develop a tool that displays the data dynamically, exactly the way top does.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News