Library for TUI programs on basis of curses
Project description
cursedspace
A python library/framework for TUI application on the basis of the curses package.
Example use
Here’s a very simple example of how to use the cursedspace package:
#!/usr/bin/env python3
from cursedspace import Application, Key, Panel
class DemoApplication(Application):
def __init__(self):
super().__init__()
self.panel = None
def main(self):
self.panel = Panel(self)
self.resize()
while True:
curses.doupdate()
key = self.read_key()
if key == Key.RESIZE:
self.resize()
elif key in [Key.ESCAPE, "q", "^C"]:
break
def resize(self):
height, width = self.size()
self.panel.resize(height, width)
self.panel.paint()
# run the application
DemoApplication().run()
Components
Application
is the main application class and provides boilerplate initialisationsPanel
is a basic panel with support for borders and key handling in the context of anApplication
LineInput
is a panel with very basic editing support.Key
provides a convenient wrapper around curses’ key system. It can be used standalone even when you don’t want to useApplication
orPanel
.ShellContext
is a convenient wrapper to execute external processes (e.g. through subprocess) and returning to the curses context afterwards again.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cursedspace-0.1.1.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for cursedspace-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9ae27cdb0a19be2542aff5c2221500fc559cabaf140e18ef4b3ad211334c64e |
|
MD5 | ea131716a9c706be7c4a717c46740071 |
|
BLAKE2b-256 | 13b8e7950d1901bd1f9ffa4d4cf5bcf5c66c07ecd9f72a349f98a2033423ccbb |