You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lasse Server aabafc0739 removing pycache 2 months ago
build/lib/colorprinter Add initial implementation of color printing utility with functions for various colors and error handling 3 months ago
colorprinter Update compiled Python bytecode files in __pycache__ directories 2 months ago
colorprinter.egg-info Add initial implementation of color printing utility with functions for various colors and error handling 3 months ago
.env Add initial implementation of color printing utility with functions for various colors and error handling 3 months ago
.gitignore Refine .gitignore to improve clarity on ignored Python artifacts and cache files 2 months ago
LICENSE Initial commit 1 year ago
README.md Updated instructions on how to use. 1 year ago
__init__.py Add initial implementation of color printing utility with functions for various colors and error handling 3 months ago
setup.py Made it into a package with setup file 1 year ago

README.md

Colorful Print Utility

This Python module provides a simple utility for printing text in various colors to the terminal. It supports printing in green, red, yellow, blue, and purple, as well as a special "rainbow" mode that cycles through colors for each argument.
Use it as as you normaly use print().

Functions

  • print_green(*args): Prints the given arguments in green color.
  • print_red(*args): Prints the given arguments in red color.
  • print_yellow(*args): Prints the given arguments in yellow color.
  • print_blue(*args): Prints the given arguments in blue color.
  • print_purple(*args): Prints the given arguments in purple color.
  • print_rainbow(*args): Prints each argument in a different color, cycling through the available colors. Supports nested lists and dictionaries.

Usage

To use this module, simply import it and call the desired function with the text you want to print as arguments. Here's an example:

git clone https://github.com/lasseedfast/colorprinter

This will clone this repo as a folder to your computer. When you want to use the colorprinter, make sure that folder is in the same folder as you're working. Then you can use it like:

from colorprinter.print_color import print_green, print_rainbow

print_green("This is in green!")
print_rainbow("This", "will", "be", "in", "multiple", "colors!")

Alternatively, you can import all functions at once using from print_color import *. However, be cautious when using this approach as it imports all public names defined in the module, which can lead to conflicts with other modules or variables in your namespace.*

Customization

The colors are defined using ANSI escape codes. You can modify the choose_color function or the color codes within each print function if you wish to customize the colors.

Requirements

This module uses standard Python libraries only and should work on any system that supports Python and ANSI escape codes for terminal colors.

License

This project is open-sourced under the MIT License. Feel free to use, modify, and distribute as you see fit.