You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

multichoicelib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multichoicelib

Miniscule Python Module for multiple choice menus using arrow keys

0.0.3
Source
pipPyPI
Maintainers
1

MultiChoiceLib

MultiChoiceLib is a one-day project, meaning that it was literally written in a day. As you can imagine, it has not extensively been tested for bugs, and it does not work at all on machines which cannot run bash.

Usage:

from multichoicelib import MultiChoice

query = MultiChoice("Pick one:", ["apples", "cherries"])
    .wAccentColor("\033[33m") # yellow
    .wQuestionPrefix("\033[4m") # underline, don't override
    .wAnswerPrefix("] ", True) # override params are optional and default to false
    .wSelectedPrefix(") ", True) # if false, will append instead
    .addOption("oranges")() # evaluate

print(query.index, query.value)

Result:

GIF image of result

Warp terminal with Grafbase theme

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts