Used for printing to the CLI in different colors and styles
Project description
AdvancedPrinter
AdvancedPrinter is a custom Python library designed to mimic the behavior of the print
function with added color and style options using ANSI escape codes. This allows you to print text with various colors and styles to the terminal.
Features
- Print text in different colors:
black
,red
,green
,yellow
,blue
,magenta
,cyan
,white
, andorange
. - Apply styles to text:
bold
=b
,italic
=it
, andunderline
=u
. - Combine styles:
b-it
,b-u
,it-u
, andb-it-u
.
Usage
-
Install the package from PyPi
pip install AdvancedPrinter
-
Import the
AdvancedPrinter
class into your Python script.from advancedprinter import AdvancedPrinter as ap
-
Use the
ap.print()
method to print colored text.# Example usage ap.print("Green text", c="green") ap.print("Underlined text", s="u") ap.print("Bold italic text", s="b-it") ap.print("Orange italic underlined", s="it-u", c='orange') ap.print("White text on blue b!", c="white", b="blue") ap.print("Bold red underlined italic text!", c="red", s="b-it-u") # Additional arguments example ap.print("This is a bold example with additional arguments.", s="b", end="***")
-
Use
ap.line()
method to print multiple colors in line using nestedf-strings
name = "Kaloian" print(f"""{ap.line("Hello, my name is", c='green', s='b')} {ap.line(f"{name}", c='blue')} {ap.line("and I'm", c='white')} {ap.line("28", c='red')} {ap.line('years old!', c='magenta')}""", end='***')
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support Me
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
AdvancedPrinter-1.0.3.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for AdvancedPrinter-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b0b319fdf021cb2bf19689ebd8a9d0577ad6aa0a37e69b7d2d9b8105e410f8b |
|
MD5 | c61fb1e6f309b652120a702c112a55c7 |
|
BLAKE2b-256 | a63ca7d99df9362079021efa5e0778f46894339f62cd0bc48ec4acb0af0f1f6b |