On this page
  1. curses.has_colors
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

curses.has_colors

Prev: curses.halfdelay | Up: curses | Next: curses.has_extended_color_support
Rel: curses.assume_default_colors, curses.baudrate, curses.beep, curses.can_change_color
Ref: docs.python.org — curses.has_colors
Tags: #public #python3 #stdlib #curses


Import

import curses
from curses import has_colors

Signature & Overview

curses.has_colors()

Return True if the terminal can display colors; otherwise, return False.

Usage

import curses

# Returns True if the terminal supports color (call after initscr() / inside wrapper())
assert callable(curses.has_colors)

Gotchas

REPL Inspect

from curses import has_colors
help(has_colors)

Linked from

Related notes