When writing Python scripts, I ask for user input all the time. This input often has a fixed set of options, those options are usually not fully listed out to the user, the user has to type them out while making no typos, and then we have to do validation afterwards to make sure they picked something valid.
Recently I discovered the prompt_toolkit
Python library, which fixes all this.
The library actually has lots of features, but the one that is relevant is this nice dropdown that lets you pick an item from pre-defined options. It saves time for the end-user and the script writer, and it'll delight anyone seeing it for the first time.
Code example below!