Skip to main content

Simple package to print text to terminal with colors and alignment

Project description

printplus

Simple package to print text to terminal with colors and alignment

Classes Available:

  •   PrintPlus
    

    Methods in the class:

    • text( message : str)
      Add text to print, can be called multiple times to add text to previous message

    • red()
      Adds red color to text added before the call which does not already have color

    • green()
      Adds green color to text added before the call which does not already have color

    • blue()
      Adds blue color to text added before the call which does not already have color

    • yellow()
      Adds yellow color to text added before the call which does not already have color

    • violet()
      Adds violet color to text added before the call which does not already have color

    • bold()
      Makes all the text added before the call bold

    • highlight()
      Highlights all the texts, even those added after the call

    • underline()
      Underkines all the texts, even those added after the call

    • blanks( char : chr)
      Specify with what char to spill the blanks. By default it will be filled by spaces

    • show()
      Prints the constructed text and clears all the values stored

    • center() and right()
      Aligns the text as specified, the one thats called latest will be applied

    • end()
      Sepcify the end char of text, by default it will be \n , the one thats called latest will be applied

    • getColored(message:str,color:str)
      Returns colored string to use in other methods, the argument color can be one of:
      - PrintPlus().colors['RED']
      - PrintPlus().colors['GREEN']
      - PrintPlus().colors['VIOLET']
      - PrintPlus().colors['BLUE']
      - PrintPlus().colors['YELLOW']
      - PrintPlus().colors['BOLD']
      - PrintPlus().colors['UNDERLINE']
      - PrintPlus().colors['HIGHLIGHT']

Usage:

from printplus import PrintPlus

printer = PrintPlus()

printer.text('Hello').green().text('World!!').red().underline().text(' by printplus').yellow().center().bold().show()

Try:

pip3 install printplus

Project details


Release history Release notifications | RSS feed

This version

1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

printplus-1.tar.gz (2.9 kB view hashes)

Uploaded Source

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