Blockly扩展,用于JupyterLab控制乐高Boost
项目描述
jupyterlab-lego-boost
Blockly扩展,用于JupyterLab控制乐高Boost
Blockly
Blockly 是 Google 开发的一个库,用于构建易于初学者使用的基于积木的编程语言。
文档:https://developers.google.com/blockly/guides/overview 仓库:https://github.com/google/blockly
乐高 Boost 机器人套件
这是一个乐高创意工具箱,提供了一种简单学习编程、工程和机器基本原理的方法。
链接:https://www.lego.com/en-de/product/boost-creative-toolbox-17101
要求
- JupyterLab >= 4.0.0
安装
要安装扩展,请执行
pip install jupyterlab-lego-boost
卸载
要删除扩展,请执行
pip uninstall jupyterlab-lego-boost
连接到乐高 Boost
注意:在使用扩展之前,请确保通过官方应用程序更新了固件。大多数与连接故障相关的问题都可以通过更新固件轻松解决。有时,每次从官方应用程序连接到 MoveHub 时,都会进行多次固件更新。
为了连接到机器人,您只需要您的 MoveHub 的蓝牙地址,您可以从设备的蓝牙设置中找到它。一旦您有了它,只需在 `examples/demo.jpblockly` 文件中替换它,特别是在连接块中,然后您就可以尝试演示了!
当您运行代码时,确保您按下 MoveHub 上的按钮,使 led 闪烁,这意味着它正在寻找连接。一旦您成功连接到它,led 将变为蓝色。每个代码都需要从使用连接块开始,并以断开连接块结束。
当您想要运行另一个代码片段时,如果您得到错误信息 通信线程不工作
,请在运行代码之前手动停止内核并重新启动它。
贡献
开发安装
注意:您需要 NodeJS 来构建扩展包。
jlpm
命令是 JupyterLab 的固定版本的 yarn,它随 JupyterLab 一起安装。您可以使用 yarn
或 npm
替代下面的 jlpm
。
micromamba create -n boost -c conda-forge python nodejs jupyterlab jupyterlab-language-pack-es-ES jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
micromamba activate boost
# Clone the repo to your local environment
# Change directory to the jupyterlab-lego-boost directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build
您可以在不同的终端中同时监视源目录并运行 JupyterLab,以监视扩展源代码的更改并自动重新构建扩展。
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
当监视命令运行时,每次保存的更改都将立即在本地上构建并可供您在运行的 JupyterLab 中使用。刷新 JupyterLab 以在浏览器中加载更改(您可能需要等待几秒钟以重建扩展)。
默认情况下,jlpm build
命令为该扩展生成源映射,以便更容易使用浏览器开发者工具进行调试。要为 JupyterLab 核心扩展也生成源映射,可以运行以下命令
jupyter lab build --minimize=False
开发卸载
pip uninstall jupyterlab-lego-boost
在开发模式下,您还需要删除由 jupyter labextension develop
命令创建的符号链接。要找到其位置,可以运行 jupyter labextension list
以确定 labextensions
文件夹的位置。然后您可以删除该文件夹中的名为 jupyterlab-lego-boost
的符号链接。
打包扩展
见 RELEASE
项目详情
jupyterlab_lego_boost-0.1.0a4.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | bd334f3398987a434d889142e2c8f6fa67d123154de4c1449c466e42a848e473 |
|
MD5 | 3d5fd8f6ed4ff1cb9799fe270af5e5f6 |
|
BLAKE2b-256 | 18fdfd71684b73ae26ba2a88e051dce9eadbc0f72714afe858a29c5831457fb6 |
jupyterlab_lego_boost-0.1.0a4-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | d835bc493ad87e707e422ed379559dfc354c8fac22b47a25694c1454afa6314f |
|
MD5 | 931cd7a6c880d733f16296ff9c2fb3c0 |
|
BLAKE2b-256 | 63860643c081d54166a3f90a91a5582034a94aab78e08e82bf57bdad91b54062 |