Skip to main content

cocube

Table of Contents

Installation

pip install cocube

Usage

Save this project(same as Snap!) to your MicroBlocks device.

# pip install -U cocube
from cocube import CoCube

client = CoCube()
found_devices = client.discover(timeout=3) # timeout=5 in windows
print("found devices:", found_devices)
client.connect("MicroBlocks QCQ", timeout=3)

client.display_character("c")

while True:
    position_x = client.position_x
    print(position_x)

ref: Snap! 中的 CoCube 库

Connect multiple devices

from cocube import CoCube

client = CoCube()
found_devices = client.discover(timeout=5)
print("found devices:", found_devices)
# connect all discovered devices
devices = [CoCube(i) for i in found_devices]

for index, device in enumerate(devices):
    device.display_character(index)

Parallel Control

from concurrent.futures import ThreadPoolExecutor

# Launching parallel tasks: https://docs.python.org/3/library/concurrent.futures.html
with ThreadPoolExecutor() as executor:
    for client in devices:
        executor.submit(client.scroll_text, "hello")

demo

ref: notebooks

License

cocube is distributed under the terms of the MIT license.

Metadata

Release files for cocube 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cocube 0.0.4
File Size Uploaded Provenance Actions
cocube-0.0.4.tar.gz 6.0 kB Without provenance Details for cocube-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cocube 0.0.4
File Interpreter ABI Platform Actions
cocube-0.0.4-py3-none-any.whl Python 3 none any Details for cocube-0.0.4-py3-none-any.whl

Total release size: 9.9 kB

Release files / cocube-0.0.4.tar.gz

Download URL cocube-0.0.4.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
85baec6f48787c2f9fd61999ae28710c1395259217661682bd1c2956205abd7d
BLAKE2b-256 checksum
How to use checksums
eb62dab956a1701d4af508bcd2fe158c98af20beb822deda58adb0d41d8f024c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.10

Release files / cocube-0.0.4-py3-none-any.whl

Download URL cocube-0.0.4-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b13993c1be66c570a95314d286c9280153c9ce7ad82197c5a07397e9094f1ee
BLAKE2b-256 checksum
How to use checksums
3f42062e178fe3cd37a22219265455a54ff1c1dc33e71ad108c2964b9510dcf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.10

Security for cocube 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page