File: test_4.py

package info (click to toggle)
colored 2.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 240 kB
  • sloc: python: 2,064; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# -*- coding: utf-8 -*-

""" Test foreground and background colors """

from colored import Fore, Back, Style
from colored.library import Library


def main():

    for color in Library.COLORS.keys():
        print(f"{getattr(Fore, color)} This is the color {color} {Style.RESET}")

    for color in Library.COLORS.keys():
        print(f"{getattr(Back, color)} This is the color {color:>20} {Style.RESET}")


if __name__ == '__main__':
    main()