CircuitPython的prompt_toolkit精简实现
项目描述
简介
Slimmed down implementation of prompt_toolkit for CircuitPython
依赖项
此驱动程序依赖于
请确保所有依赖项都可在CircuitPython文件系统中使用。这可以通过下载 Adafruit库和驱动程序捆绑包 或使用 circup 安装单独的库轻松实现。
从PyPI安装
此库可在PyPI中用于需要它的CircuitPython工具。如果您实际上想使用它来在CPython(而不是CircuitPython)上,我们建议使用PyPI上也可用的完整 prompt_toolkit 库。
使用Circup安装到连接的CircuitPython设备
确保您在Python环境中安装了circup。如果需要,请使用以下命令进行安装
pip3 install circup
安装circup并连接您的CircuitPython设备后,请使用以下命令进行安装
circup install adafruit_prompt_toolkit
或以下命令更新现有版本
circup update
使用示例
# This example works over the second CDC and supports history.
import usb_cdc
# Rename import to make the rest of the code compatible with CPython's prompt_toolkit library.
import adafruit_prompt_toolkit as prompt_toolkit
# If the second CDC is available, then use it instead.
serial = usb_cdc.console
if usb_cdc.data:
serial = usb_cdc.data
session = prompt_toolkit.PromptSession(input=serial, output=serial)
while True:
response = session.prompt("$ ")
print("->", response, file=serial)
文档
此库的API文档可在Read the Docs上找到。
有关构建库文档的信息,请参阅本指南。
贡献
欢迎贡献!在为此项目做出贡献之前,请阅读我们的行为准则,以帮助保持项目的友好氛围。
项目详情
关闭
adafruit_circuitpython_prompt_toolkit-1.0.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 96e33ebe26f69abfa98330e7b028e54ab836c07ab6e9bf0c5f510cf1649bb15f |
|
MD5 | d77e2be93fd052507600eec17f4b391c |
|
BLAKE2b-256 | 3beeec1e46d6ae4682dd935c4c847c40744bc1952cc4a31eeebbed78a9c61d44 |
关闭
adafruit_circuitpython_prompt_toolkit-1.0.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 13c381eb386c6e59c2264ba1440ff6d4f8dbfbdd63cf7669bbf87669dfd51303 |
|
MD5 | 4620de2c7f3d381607f6471a7626a8e7 |
|
BLAKE2b-256 | c818006bd1194088cb6408492429a31a9d23458d080d48a6544f9f82be2e7574 |