Skip to main content

Recycle microbits exercises in python using 5 * 5 strings and some coloring

Project description

pycrobit

Coverage Status PyPI version Code style: black PRs Welcome

Python library that permits to recycle microbits exercises in python using 5 * 5 strings and some coloring without the hassle of handling terminal coloring and refresh.

Context

There's a lot of fun exercises for children using microbits but a lot less using python.

Installation

pip install pycrobit[colorama]

Or download pycrobit.py for offline use.

Example of use

from pycrobit import Fore, Pycrobit

all_lit = """
*****
*****
*****
*****
*****
"""
all_off = """
.....
.....
.....
.....
....."""


pycrobit = Pycrobit(framerate=0.50)
while True:
    pycrobit.display(all_lit)  # Lit red by default
    pycrobit.display(all_off)
    pycrobit.display(all_lit, {"*": Fore.YELLOW})
    pycrobit.display(all_off)
    pycrobit.display(all_lit, {"*": Fore.GREEN})
    pycrobit.display(all_off)
    pycrobit.display("*.*.*\n" * 5)
    pycrobit.wait(-0.25)
    pycrobit.display(".***." * 5)
    pycrobit.wait(-0.25)

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

pycrobit-0.2.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

pycrobit-0.2.0-py3-none-any.whl (4.1 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