Python Client of CodeLab Adapter v3.
# Python >= 3.6
pip install codelab_adapter_client
from codelab_adapter_client import AdapterNode
codelab-message-monitor # subscribes to all messages and print both topic and payload.
codelab-message-trigger # pub the message in json file(`/tmp/message.json`).
codelab-message-pub -j '{"topic":"eim/test","payload":{"content":"test contenst"}}'
/tmp/message.json
:
{
"topic": "adapter_core/exts/operate",
"payload": { "content": "start", "node_name": "extension_eim" }
}
import pip
pip.main(['install', 'https://github.com/CodeLabClub/codelab_adapter_client_python/archive/master.zip'])
# 安装完成后在jupyterlab restart 一下 kernel
与 Scratch EIM 积木配合使用
from codelab_adapter_client.message import receive_message, send_message