Skip to main content

This library standardizes console color output across multiple platforms.

Project description

Icon TotalDownloads WeekDownloads Python3 License Docs

pip install tamcolors

table tennis example

import tamcolors
tamcolors.examples.tabletennis.run()

basic example

import tamcolors
tamcolors.examples.basic.run()
import tamcolors
tamcolors.printc("Hello", "World!", ("light blue", "white"), same_color=True)
name = tamcolors.inputc("Whats Your Name? >>> ", ("light aqua", "gray"))
tamcolors.clear()
tamcolors.printc("Hello, ", ("default", "default"), name, (2, 7), "!", ("gray", "light aqua"), sep="")

icon example

import tamcolors
tamcolors.examples.icon.run()
from tamcolors import tam, tam_tools, tam_io


class BootLogo(tam.tam_loop.TAMFrame):
    def __init__(self):
        super().__init__(fps=10,
                         char=" ",
                         foreground_color=2,
                         background_color=0,
                         min_width=70, max_width=70, min_height=40, max_height=40)

        self.icon = tam_tools.tam_fade.tam_fade_in(buffer=tam_tools.tam_icon.get_icon(),
                                                   char=" ",
                                                   foreground_color=tam_io.tam_colors.BLACK,
                                                   background_color=tam_io.tam_colors.BLACK)
        self.wait = 10

    def update(self, tam_loop, keys, loop_data):

        if not self.icon.done():
            self.icon.slide()
        else:
            self.wait -= 1

        if self.wait == 0:
            tam_loop.done()

    def draw(self, tam_buffer, loop_data):
        tam_buffer.clear()

        tam_buffer.draw_onto(self.icon.peak(),
                             *tam_tools.tam_placing.center(x=35, y=15, buffer=self.icon.peak()))

        tam_tools.tam_print.tam_print(tam_buffer, *tam_tools.tam_placing.center(x=35,
                                                                                y=28,
                                                                                width=len("tamcolors"),
                                                                                height=1),
                                      text="tamcolors",
                                      foreground_color=tam_io.tam_colors.LIGHT_WHITE,
                                      background_color=tam_io.tam_colors.BLACK)

tam.tam_loop.TAMLoop(BootLogo()).run()

versions of Python currently supported

  • 3.8

  • 3.7

  • 3.6

  • 3.5

platforms tested on

  • Windows 10

  • Ubuntu 20.04

  • macOS 10.15.5

long term goals

  • build a community that builds fun terminal games

  • make windows run more efficient

  • text editor

  • .ci testing

goals

  • support Solaris

  • support FreeBSD

1.1.0 goals

  • save/rest Windows buffer size on exit

  • clean up Windows C/C++

  • add RGB color mode (more than 16 colors at a time!)

  • add .wav support

  • add sound tools

versions

1.0.4

  • 8/13/2020

  • added more examples

  • bdist_wheel for Linux

  • cleaned up win_tam, uni_tam and any_tam

  • added alpha color for TAMBuffer

  • set and get rgb value of color (fixed PowerShell colors)

1.0.3

  • 7/29/2020

  • tamcolors

  • bdist_wheel for macOS

  • added more examples

  • added documentation

  • added tests for tam_basic

  • added default console colors

  • supports Python 3.8

  • supports Python 3.7

  • supports Python 3.6

  • supports Python 3.5

1.0.2

  • 7/22/2020

  • tamcolors is now very usable

  • bdist_wheel for Windows

  • added non interrupting keyboard input

  • added TAMLoop

  • added tam_tools

  • added tests

  • supports Python 3.8

  • supports Python 3.7

  • supports Python 3.6

  • supports Python 3.5

0.2.0

  • 2/1/2018

  • tamcolors proof of concept

  • added printc

  • added inputc

  • added textBuffer

  • supports Python 3.6

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

tamcolors-1.0.4.tar.gz (11.1 MB view hashes)

Uploaded Source

Built Distributions

tamcolors-1.0.4-cp38-cp38-win_amd64.whl (80.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

tamcolors-1.0.4-cp38-cp38-win32.whl (79.4 kB view hashes)

Uploaded CPython 3.8 Windows x86

tamcolors-1.0.4-cp38-cp38-macosx_10_9_x86_64.whl (74.0 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

tamcolors-1.0.4-cp37-cp37m-win_amd64.whl (80.5 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

tamcolors-1.0.4-cp37-cp37m-win32.whl (79.3 kB view hashes)

Uploaded CPython 3.7m Windows x86

tamcolors-1.0.4-cp37-cp37m-macosx_10_9_x86_64.whl (74.0 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

tamcolors-1.0.4-cp36-cp36m-win_amd64.whl (80.5 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

tamcolors-1.0.4-cp36-cp36m-win32.whl (79.3 kB view hashes)

Uploaded CPython 3.6m Windows x86

tamcolors-1.0.4-cp36-cp36m-macosx_10_9_x86_64.whl (76.3 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

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