Skip to main content

Build StatusDocumentation StatusCoverage Status

curses-menu

A simple Python menu-based GUI system on the terminal using curses. Perfect for those times when you need a GUI, but don’t want the overhead or learning curve of a full-fledged GUI framework. However, it’s also flexible enough to do cool stuff like on-the-fly changing of menus and is extensible to a large variety of uses.

http://curses-menu.readthedocs.org/en/latest/

./images/curses-menu_screenshot1.png

Installation

Tested on Python 3.8+ pypy and pypy3.

The curses library comes bundled with python on Linux and MacOS. Windows users can visit http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses and get a third-party build for your platform and Python version.

Then just run

pip install curses-menu

Usage

It’s designed to be pretty simple to use. Here’s an example

menu = CursesMenu("Root Menu", "Root Menu Subtitle")
item1 = MenuItem("Basic item that does nothing", menu)
function_item = FunctionItem("FunctionItem, get input", input, ["Enter an input: "])
print(__file__)
command_item = CommandItem(
    "CommandItem that opens another menu",
    f"python {__file__}",
)

submenu = CursesMenu.make_selection_menu([f"item{x}" for x in range(1, 20)])
submenu_item = SubmenuItem("Long Selection SubMenu", submenu=submenu, menu=menu)

submenu_2 = CursesMenu("Submenu Title", "Submenu subtitle")
function_item_2 = FunctionItem("Fun item", input, ["Enter an input"])
item2 = MenuItem("Another Item")
submenu_2.items.append(function_item_2)
submenu_2.items.append(item2)
submenu_item_2 = SubmenuItem("Short Submenu", submenu=submenu_2, menu=menu)

menu.items.append(item1)
menu.items.append(function_item)
menu.items.append(command_item)
menu.items.append(submenu_item)
menu.items.append(submenu_item_2)

menu.start()
_ = menu.join()

Testing Information

Currently the platforms I’m manually testing on are MacOS in iTerm2 on zsh with and without TMUX and Windows 10with both powersehll and cmd.exe in and out of Windows Terminal. If a bug pops up on another configuration, no promises that I’ll be able to reproduce it.

Metadata

Release files for curses-menu 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curses-menu 0.9.0
File Size Uploaded
curses_menu-0.9.0.tar.gz 76.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for curses-menu 0.9.0
File Interpreter ABI Platform
curses_menu-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 93.8 kB

Release files / curses_menu-0.9.0.tar.gz

Download URL curses_menu-0.9.0.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2d4dc7f3ed27377b3f455dd56cbe87d1bc4e9c09af558dc89eb01e36fe95eb97
BLAKE2b-256 checksum
How to use checksums
f5d0b1e36f29937b6c5dd75563deebb7224dd71ea0b471ee9c44df601a7be7f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / curses_menu-0.9.0-py3-none-any.whl

Download URL curses_menu-0.9.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb24df4948c32216663439470630b9732a16d09bbbb533c5b0aa8205aeb292fd
BLAKE2b-256 checksum
How to use checksums
6f7b8c1aeda890e6af299bfb56ecab40dde188e95b67d1852a6e63612d85f74a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.3

2 release files

0.8.1

2 release files

0.7.1

2 release files

0.6.14

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.5.0

2 release files

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release 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