Quick Start

Get up and running with ascii_colors in minutes.

Option 2: Direct Printing

Use these methods for simple, immediate styled output directly to the console. They do not use the logging system (handlers, levels, formatters).

quickstart_direct_print.py
 1from ascii_colors import ASCIIColors
 2
 3# Direct print methods bypass the logging system
 4ASCIIColors.red("This is an urgent error message.")
 5ASCIIColors.green("Operation completed successfully!")
 6ASCIIColors.yellow("Warning: Disk space low.")
 7
 8# Combine with styles and specific colors
 9ASCIIColors.bold("This is important!", color=ASCIIColors.color_bright_white)
10ASCIIColors.underline("Underlined text.", color=ASCIIColors.color_cyan)
11ASCIIColors.italic("Italic blue text.", color=ASCIIColors.color_blue)
12
13# Use background colors
14ASCIIColors.print_with_bg(
15    " Black text on Orange background ",
16    color=ASCIIColors.color_black,
17    background=ASCIIColors.bg_orange
18)
19
20# Combine foreground, background, and style
21ASCIIColors.print(
22    " Bold Red text on Yellow background ",
23    color=ASCIIColors.color_red,
24    style=ASCIIColors.style_bold,
25    background=ASCIIColors.bg_yellow
26)