Skip to main content

library to help with curses programming

Installation

From the project root directory:

$ python setup.py install

Usage

The easiest method is to just decorate your function, and use the injected scr argument:

from time import sleep
from ezcurses import curse

@curse
def main(scr, message_string):
    w, h = scr.max_size()
    scr.write(message_string, pos=(w // 2, h // 2))
    scr.refresh()
    sleep(1)

if __name__ == '__main__':
    main('Hello world!')

You can also use the Cursed context manager. Here’s an example with windows with backgrounds and borders and colors:

from ezcurses import Cursed

with Cursed() as scr:
    w, h = scr.max_size()
    win1 = scr.new_win(orig=(0, 0), size=(10, 10))
    win2 = scr.new_win(orig=(10, 0), size=(10, 10))
    win1.border()
    win2.border()
    win1.background('+', color='red')
    win2.background('.', color=('green', 'blue'))
    win1.draw()
    win2.draw()
    s = win1.getstr((0, 0), echo=True)
    win2.write(s, (0, 0), color=('red', 'black'))
    win2.draw()
    win1.write('Press q to quit', (0, 0), color=('black', 'red'))
    while win1.getkey() != 'q':
        pass

Release Notes

0.2.9:
  • Rename _msgs to Menu.items

0.2.8:
  • Much more intricate menu logic and new multi_menu.py example

0.2.7:
  • Fix menu origin in windows bug

0.2.6:
  • Make layout creatable with Screen.new_layout(border=True)

0.2.5:
  • Add Layout feature for bootstrap like rows and columns

0.2.4:
  • Add Menu functionality and an example in examples/menu_example.py

0.2.3:
  • make it much more tolerable for floats, if user does math stuff

0.2.2:
  • add curse decorator

  • rename main context manager to Cursed

0.2.1:
  • fixed a few bugs in window without size

0.2.0:
  • lots of clean up and testing, fix README

0.1.2:
  • Make positional optional and a keyword pos for the getstr function

  • Add documentation to API

0.1.1:
  • Make position optional for write and default (0, 0) like other funcs

0.1.0:
  • New features for curses windows

  • get input, string and characters

  • add strings with colors to the window

  • add borders

  • draw lines

  • change background

  • very functional as is

0.0.1:
  • Project created

Metadata

Release files for ezcurses 0.2.9

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

Source distribution (sdist)

Source distribution for ezcurses 0.2.9
File Size Uploaded
ezcurses-0.2.9.tar.gz 10.0 kB Details

Release files / ezcurses-0.2.9.tar.gz

Download URL ezcurses-0.2.9.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
258cfec26664c1a02e74d55c5a49639ade799f0956c1d3f2af1531a9405e0649
BLAKE2b-256 checksum
How to use checksums
a088fd5fcea08cc798a79876fae2d48fb79910ac3337931cabf3ebad489c6431
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

1 release file

0.3.0

1 release file

0.2.12

1 release file

0.2.11

1 release file

0.2.10

1 release file

This release

0.2.9 This release

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.1

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