A Desktop Python 2.7 Countdown Timer with CircuitPython and PyPortal
Tags: python, circuitpython, hardware, microcontrollers
Published: 2019-07-16 19:00:43

## ✨Did you know that Python 2.7 won't be maintained after January 1st, 2020? ✨

Inspired by [Phildini](https://twitter.com/phildini)'s [Python Clock](https://pythonclock.org), I wanted to make a desktop version of a Python 2.7 countdown timer for the big event.

My countdown timer matches my mood, with thirteen different themes to choose from 💅.

### In Action

![The PyPortal Python 2.7 Countdown Clock in Action!](https://d33wubrfki0l68.cloudfront.net/a6cb32f3112d6ffabf05c398d831eeed94033fc3/08811/img/2019/2019-blog-circuitpython-pyportal-python27-event-countdown/in-action.gif)

Most importantly, the countdown timer had to be written in Python itself. I used [CircuitPython](https://circuitpython.org/) and a wifi-enabled Adafruit [PyPortal](https://www.adafruit.com/product/4116) with a touchscreen. The touchscreen allows you to quickly cycle through themes.

### Theme Examples

![A Snek Theme](https://thepracticaldev.s3.amazonaws.com/i/m5airccrb160uf4pjl81.jpg)

![An Elegant Black and White Theme](https://thepracticaldev.s3.amazonaws.com/i/tk0c49tis3yu70t1cwi9.jpg)

### How?

The [PyPortal](https://www.adafruit.com/product/4116) is an wifi-enabled microcontroller device featuring a 3" capacitive touchscreen and CircuitPython baked in.

It can be programmed with [CircuitPython](https://circuitpython.org/), a variant of Python that can be used to program microcontrollers, originally forked from [MicroPython](https://github.com/micropython/micropython).

I used the [Python Extension for Visual Studio Code](https://code.visualstudio.com/docs/languages/python?WT.mc_id=py27countdown-blog-ninaz), along with [workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces?WT.mc_id=py27countdown-blog-ninaz) for easy development. One workspace allowed me to keep my PyPortal code side-by-side with my local (version controlled!) codebase.

### Show Me the Code!

The repository with all the code and setup instructions you'll need to get your own countdown clock working is available on my GitHub.

{% github nnja/py27_countdown %}

### Make the Switch

You might be surprised, but Python 3.0 is over ten years old. Python 2.7 support was originally supposed to drop in 2015, but the deadline was extended another 5 years to 2020 to provide ample time to make the switch.

Over the past ten years, maintaining Python 2 has been a strain on core developers, library authors, and other volunteers and open source contributors who make the language great.

As support for Python 2.7 is sunset in 2020, expect major packages to end Python 2.7 support as well such as Tensorflow, PyTest, and [many more](https://python3statement.org/).

{% twitter 1133496146700058626 %}

It's time to say goodbye to the past, and look towards the future with support for incredible features you might be missing out on, like [f-strings](https://docs.python.org/3/whatsnew/3.6.html#pep-498-formatted-string-literals).

If you haven't started your migration yet, why wait? Don't procrastinate. At the time of this blog post, you have 169 days left to go.