Skip to main content

Goals

A collection of curses utils for performing simple UI tasks. Currently this includes a simple console and a menu with vi-like bindings.

Installation

Requires python 3.

pip3 install curses-util should do the trick, or else python setup.py install from source.

Usage

SimpleConsole

A simple console with a single line input window.

import curses_util

def handle_input(console, input):
    console.log("Got input: " + input) #Logs result to the output window.

console = curses_used.SimpleConsole(handle_input)
console.log("Welcome")

Menu

This can be used to vend a collection of items which the user may then select one or more of. Navigation can be performed using standard vi bindings (count operands are also supported) or via the arrow keys. Multiple items can be selected with ‘multi_vend()’ if the user presses m over each of the items they wish to select and then presses enter.

import curses_util

menu = curses_util.Menu()

items = [ str(i) for i in range(100) ]
selected = menu.vend(items)

print("The following items were selected: \n")
print("\n".join(items), "\n")

Bugs, etc..

If you bother to read the code and invariably feel the need to abuse the person who wrote it, know that such sentiments will be happily received at r.vaiya@gmail.com.

Download files

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

Source Distribution

curses-util-0.0.25.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file curses-util-0.0.25.tar.gz.

File metadata

  • Download URL: curses-util-0.0.25.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for curses-util-0.0.25.tar.gz
Algorithm Hash digest
SHA256 5a5b4832121f716b963ce310536f2c172245a0678e820e87eb7fb01d4b368322
MD5 0ac6c451f7c9b86cabc8d4250044116a
BLAKE2b-256 14f42f52d68fa5df136fd68d72d6e9976789171dc0bf8752ee703a60ff419cca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.25 This release

1 file

0.0.24

1 file

0.0.23

1 file

0.0.22

1 file

0.0.21

1 file

0.0.20

1 file

0.0.19

1 file

0.0.18

1 file

0.0.17

1 file

0.0.15

1 file

0.0.14

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page