Skip to main content

Colored Output - c_out. Python print with a style!

Project description

Introduction

Colored Output = c_out

You don't have to tell me how monotonous it is to use the same old print statement in python, as there is no option to format it. Moreover, we all have faced problems while debugging our code with countless print statements but no way to highlight any of it.

Well we can definitely install/import third-party packages, but some of us just prefer the old school solutions.

I have a simple, yet effective solution for you. What if I tell you, it is possible to create a custom class yourself which can format the output in the terminal?

Using this module you can directly format the output you see in your command line interface without using any external packages.
It uses ANSI Escape Codes to format the standard output.

Installation

pip install c_out

Usage

Import

from c_out.beauty_print import c_out, TextColor, BackgroundColor, Style

Different Ways to use

Normal print

c_out("Hello World")  

Print with just text color

c_out("Hello World", text_color=TextColor.BLUE)  

Print with just background color

c_out("Hello World", bg_color=BackgroundColor.BLACK)  

Print with text color and background color

c_out("Hello World", text_color=TextColor.RED, bg_color=BackgroundColor.BLACK, styles=[Style.BOLD])  

Print with text color, background color and font styles

c_out("Hello World", text_color=TextColor.RED, bg_color=BackgroundColor.BLACK, styles=[Style.BOLD])  
c_out("Hello World", text_color=TextColor.RED, bg_color=BackgroundColor.BLACK, styles=[Style.BOLD, Style.STRIKETHROUGH, Style.ITALIC])

Print with separator and text color

c_out("Hello", "World", text_color=TextColor.RED, sep='\n')  

Print with end of line and text color

c_out("Hello", "World", text_color=TextColor.RED, end='\t')  

And there are many more combinations that you can try yourself.

Choices

Current Choices for TextColor

  • BLACK
  • RED
  • GREEN
  • ORANGE
  • BLUE
  • PURPLE
  • CYAN
  • LIGHTGREY
  • DARKGREY
  • LIGHTRED
  • LIGHTGREEN
  • YELLOW
  • LIGHTBLUE
  • PINK
  • LIGHTCYAN

Current Choices for BackgroundColor

  • BLACK
  • RED
  • GREEN
  • ORANGE
  • BLUE
  • PURPLE
  • CYAN
  • LIGHTGREY

Current choices for Styles

  • BOLD
  • UNDERLINE
  • ITALIC
  • STRIKETHROUGH
  • SELECTED

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

c_out-1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

c_out-1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file c_out-1.0.tar.gz.

File metadata

  • Download URL: c_out-1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for c_out-1.0.tar.gz
Algorithm Hash digest
SHA256 74d32c4621ebb2175c6d8d9ed262011b18c93b910ab6fd23fb00275d676e5ed2
MD5 e2cff12dee63b1b3a366bde72788df71
BLAKE2b-256 df9ac4734fa472fd7d6117d0fe2fe99822d692d9c32fb5014745f91cd263f455

See more details on using hashes here.

File details

Details for the file c_out-1.0-py3-none-any.whl.

File metadata

  • Download URL: c_out-1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for c_out-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90dfc7adf62641c4c6a4f905cee27abe3cabe0882d2dbef8b657ab5ecd044ecd
MD5 ab802cea64b13cdb44ad466d81209534
BLAKE2b-256 8819f802a64615fa100e651e7c154602855deecc7b851963ac97ef912c01e083

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page