Command Line UI’s in Python

A practical overview for you and me.

Keno Leon
8 min readJul 17, 2021

--

Like any warm blooded software developer I love me a good GUI with buttons, colors and drop down shadows, yet the reality is that most of of these things while nice to have are usually overkill for your average python script.

So here we will check out the alternative, humble command line user interfaces in python, come along if like me you are new to the subject and want to see what goes into making them.

⚠️ Note: This is a beginner friendly overview rather than an in- depth tutorial, so after reading this you should have a good idea of what your options are for Command Line Interfaces (CLI) along with some basic code samples which should inform you what to learn next.

The basics… a Yes/No UI

The most basic UI I can think of would consist of a prompt on your command line asking (prompting) for a simple Yes/No or similar answer and then the script does something depending on your answer, if you think about it, the vast majority of UIs graphic or otherwise use this pattern:

Even the most visually complex UI basically asks you “what you want !”

--

--