Skip to main content

display colors in console

Project description

pycols

A Python module for colorating console content

Installation

Using pip

You can install pycols via pip using

  • in a commandline:

  • py -m pip install pycols
    

  • in a python script:

  • import os
    os.system('py -m pip install pycols')
    

    Usage

    Colorating content

    1. Create a pycols.color object:
      import pycols
      c = pycols.color()
      

      This will initialize all three style elements pycols can alter: Style, Foreground and Background.

    2. Given that you want to make a text e.g. red for an error, you can change this:
      print("An error occured")
      

      easily to the following:

      code_red = c.col("RED")
      print(code_red + "An error occured")
      

      Here, the color.col search method is used.
      There is also a search methods for background colors (color.bcol).
      These two methods will automatically switch to searching for light colors with the color.lcol / color.lbcol methods, when they detect a "LIGHT_" part in your color description.

    3. Reset the coloring with one of the following:
      print(c.col("RESET"))
      

      for resetting only the color of the foreground,

      print(c.bcol("RESET"))
      

      for resetting only the color of the background

      print(c.RESET)
      

      for resetting only the current styling or finally

      print(c.RESET_ALL)
      

      for resetting all of them.

    Others

    Use the following to get information about your release and the author of the module:

    pycols.about()
    

    More coming soon

    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

    pycols-1.0.3.tar.gz (3.5 kB view hashes)

    Uploaded Source

    Built Distribution

    pycols-1.0.3-py3-none-any.whl (3.8 kB view hashes)

    Uploaded Python 3

    Supported by

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