tamcolors

This library standardizes console color output across multiple platforms. It also can get keyboard inputs without interrupting the console output and can run a console application at ~25 FPS.

table tennis example

TableTennis

import tamcolors
tamcolors.examples.tabletennis.run()

basic example

BasicExample

import tamcolors
tamcolors.examples.basic.run()

import tamcolors
from tamcolors.tam_io.tam_colors import *
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, (GREEN, WHITE), "!", ("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=tam_io.tam_colors.GREEN,
                         background_color=tam_io.tam_colors.BLACK,
                         min_width=57, max_width=57, min_height=20, max_height=20)

        self.icon = tam_tools.tam_fade.tam_fade_in(surface=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, *args):

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

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

    def draw(self, tam_surface, loop_data, *args):
        tam_surface.clear()

        tam_surface.draw_onto(self.icon.peak(), 0, 0)


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

versions of Python currently supported

  • 3.9
  • 3.8
  • 3.7
  • 3.6

platforms tested on

  • Windows 10
  • Ubuntu 20.04
  • macOS 10.15.5

goals

  • IO event bus
  • support "get_keyboard_name" on macOS - Objective-C -> C++ -> Python
  • support "key state mode" on macOS - Objective-C -> C++ -> Python
  • add SHIFT KEY and other keys

long term goals

  • build a community that builds fun terminal games
  • text editor
  • make and change fonts at run time
  • add .wav support

2.0.0 goals

  • add .wav support
  • add .wav tests

1.3.0 goals

  • fix exit clear - Done
  • add wait_key - Done
  • add frame_done - Done
  • add multi console example - Done
  • add key state keyboard mode - In Progress
  • make tam_loop multi console friendly - Done
  • rename items from buffer to surface - Done
  • update tamcolors icon - Done
  • support GER_GERMAN, FRE_FRENCH, SPA_SPANISH, LAT_SPANISH, ... Keyboards - Done
  • supports Python 3.9
  • supports Python 3.8
  • supports Python 3.7
  • supports Python 3.6

what defines a release?

  • x.?.? - tamcolors has matured to a new level of capability.
  • ?.x.? - Backwards compatibility was broken for most programs.
  • ?.?.x - Most programs should still run in this release.
  • All releases can have new features, bug fixes, depreciation and new tests.

GitHub