Skip to main content

Curses-like terminal wrapper, with colored strings!

Project description

[![Build Status](](
[![Documentation Status](](
![Curtsies Logo](

Curtsies is a Python 2.7 & 3.4+ compatible library for interacting with the terminal.
This is what using (nearly every feature of) curtsies looks like:

from __future__ import unicode_literals # convenient for Python 2
import random

from curtsies import FullscreenWindow, Input, FSArray
from curtsies.fmtfuncs import red, bold, green, on_blue, yellow

print(yellow('this prints normally, not to the alternate screen'))
with FullscreenWindow() as window:
with Input() as input_generator:
msg = red(on_blue(bold('Press escape to exit')))
a = FSArray(window.height, window.width)
a[0:1, 0:msg.width] = [msg]
for c in input_generator:
if c == '<ESC>':
elif c == '<SPACE>':
a = FSArray(window.height, window.width)
s = repr(c).decode()
row = random.choice(range(window.height))
column = random.choice(range(window.width-len(s)))
color = random.choice([red, green, on_blue, yellow])
a[row, column:column+len(s)] = [color(s)]

Paste it in a `` file and try it out!

Installation: `pip install curtsies`



[FmtStr]( objects are strings formatted with
colors and styles displayable in a terminal with [ANSI escape sequences](>`_).

(the import statement shown below is outdated)


[FSArray]( objects contain multiple such strings
with each formatted string on its own row, and FSArray
objects can be superimposed on each other
to build complex grids of colored and styled characters through composition.

(the import statement shown below is outdated)


Such grids of characters can be rendered to the terminal in alternate screen mode
(no history, like `Vim`, `top` etc.) by [FullscreenWindow]( objects
or normal history-preserving screen by [CursorAwareWindow]( objects.
User keyboard input events like pressing the up arrow key are detected by an
[Input]( object.


* [Tic-Tac-Toe](/examples/


* [Avoid the X's game](/examples/


* [Bpython-curtsies uses curtsies](


* [More examples](/examples)


* [Curtsies Documentation](
* Curtsies was written to for [bpython-curtsies](
* `#bpython` on irc is a good place to talk about Curtsies, but feel free
to open an issue if you're having a problem!
* Thanks to the many contributors!
* If all you need are colored strings, consider one of these [other

Project details

Download files

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

Files for curtsies, version 0.3.0
Filename, size & hash File type Python version Upload date
curtsies-0.3.0.tar.gz (47.1 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page