#64 Seven-Segment Display Module

A seven-segment display is a type of LCD component used to display numbers in pocket calculators, microwave ovens, and other small electronic devices. Through different combinations of seven line-shaped segments in an LCD, a seven-segment display can represent the digits 0 through 9. They look like this:

   __         __    __          __    __   __    __    __
  |  |    |   __|   __|  |__|  |__   |__     |  |__|  |__|
  |__|    |  |__    __|     |   __|  |__|    |  |__|   __|

The benefit of this program is that other programs can import it as a module. Project 14, “Countdown,” and Project 19, “Digital Clock,” import the sevseg.py file so they can use its getSevSegStr() function. ...

Get The Big Book of Small Python Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.