Skip to main content

Library for quick CLI user prompts, input, and menus.

Project description

Introduction

This project provides a Python 2.7/3.x library that allows the user to quickly create CLI prompts for user input. The main features are the following:

  • Simple multi-entry menus.

  • Prompt for yes/no response.

  • Prompt for integer response.

  • Prompt for float response.

  • Optional default value.

  • Optional validity check.

  • Should work on any platform without additional dependencies.

Status

Currently, this project is in the development release stage. While this project is suitable for use, please note that there may be incompatibilities in new releases.

Requirements

Qprompt should run on any Python 2.7/3.x interpreter without additional dependencies.

Installation

Qprompt can be installed with pip using the following command: pip install qprompt

Additional, Qprompt can be installed from source by running: python setup.py install

Usage

The following is an example of basic input usage:

num = qprompt.ask_int("Enter a multiple of 3", vld=lambda x: x > 0)
if qprompt.ask_yesno("Show number?", dft=True):
    print(num)

The following is an example of basic menu usage:

menu = qprompt.Menu()
menu.add("p", "Previous")
menu.add("n", "Next")
menu.add("e", "Exit")
choice = menu.show()

Check out the following additional examples of Qprompt; more can be found here:

Documentation

The full documentation for this project can be found here on Read the Docs.

Similar

The following projects are similar and may be worth checking out:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qprompt-0.7.0.zip (9.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page