ezcurses
library to help with curses programming (Python 3.3+ compatible)
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=(20, 20))
win2 = scr.new_win(orig=(20, 0), size=(20, 20))
win1.border()
win2.border()
win1.background('+', color='red')
win2.background('.', color=('green', 'blue'))
win1.refresh()
win2.refresh()
s = win1.getstr((1, 1), echo=True)
win2.write(s, (1, 1), color=('red', 'black'))
win2.refresh()
win1.write('Press q to quit', (1, 1), color=('black', 'red'))
while win1.getkey() != 'q':
pass
Release Notes
:0.2.12:
- Add windows support with unicurses :0.2.11:
- Readme example was bad :0.2.10:
- Add multi_menu feature for selections spanning a screen :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
cursedecorator - 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
posfor thegetstrfunction - Add documentation to API :0.1.1:
- Make position optional for
writeand 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.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezcurses-0.3.2.tar.gz | 6.5 kB | Without provenance | Details for ezcurses-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezcurses-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for ezcurses-0.3.2-py3-none-any.whl |
Total release size: 14.8 kB
Release files / ezcurses-0.3.2.tar.gz
| Download URL | ezcurses-0.3.2.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79d55f6a199f2b5ddd62a08c3316ee84983dad316f238884084015b7c8a2546e
|
|
BLAKE2b-256 checksum How to use checksums |
a98e245c8ef860f255a79afa92f4070abddecae6b79607640c34a514e7e8c87f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ezcurses-0.3.2-py3-none-any.whl
| Download URL | ezcurses-0.3.2-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f6bbb132655267a5401f4a6bc5995d192dd7dd1d233aab2205eee262f694a18
|
|
BLAKE2b-256 checksum How to use checksums |
47ab2e9f54c4019a40242409d07cc714d7e43700adf0202014538b9ac8dc3a38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for ezcurses 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.