git @ Cat's Eye Technologies Dipple / master python / curses_example.py
master

Tree @master (Download .tar.gz)

curses_example.py @masterraw · history · blame

#!/usr/bin/env python

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

import curses

if __name__ == '__main__':
    w = curses.initscr()
    curses.start_color()
    curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
    w.attron(curses.color_pair(1))
    w.move(12, 20)
    w.addstr("Hello there")
    w.attroff(curses.color_pair(1))
    w.getch()
    curses.endwin()