python3模块和cli工具控制cleware红绿灯

cleware-traffic-light的Python项目详细描述


Cleware红绿灯

LicensePyPI version

cleware红绿灯一个用python3编写的易于使用的cli工具,用于控制cleware usb traffic light。 它支持多个红绿灯控制,并在您自己的python应用程序中用作模块。

用法

模块

fromtraffic_lightimportClewareTrafficLight,Color,StateClewareTrafficLight().red_on()ClewareTrafficLight().yellow_off()# with address for specific lightClewareTrafficLight(21).green_on()

cli

ctl --red on
ctl -r on
ctl --red on --green off
ctl --red off --green on --address 19

安装

使用pip安装cleware红绿灯

sudo pip3 install cleware-traffic-light

Linux

要将cli用作用户,首先必须创建usb规则

# go to directorycd /etc/udev/rules.d/

# create file with the rule
vi 99-clewareampel.rules

内容

SUBSYSTEM=="usb", ATTR{idVendor}=="0d50", ATTR{idProduct}=="0008", MODE="666"

帮助

usage: ctl [-h][-r {on,off}][-y {on,off}][-g {on,off}][-a ADDRESS]

Turns the led of the cleware traffic light on or off

optional arguments:
  -h, --help            show this help message and exit
  -r {on,off}, --red {on,off}
                        Controlls the red led
  -y {on,off}, --yellow {on,off}
                        Controlls the yellow led
  -g {on,off}, --green {on,off}
                        Controlls the green led
  -a ADDRESS, --address ADDRESS
                        Specifies which traffic light should be used

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javajexcel包装文本问题   EclipseJavaEnum缩进超过左括号。如何让它看起来更正常?   java有办法包含Tomcat 6 catalina。out和localhost。在网络应用的日志文件中记录内容?   java如何永久性地阻止JavaFX代码在eclipse中被突出显示为错误?   如何在java中优化两个for循环(for循环中的for循环)   java如何在我的windows机器上从jar文件创建mac osx的可执行文件   使用记忆化/动态规划的Java组合学   Java中的游荡对象垃圾收集   java为什么我在JSP和JDBC和MySQL中遇到连接失败错误   java轮询Pod的就绪状态   如何创建电子邮件并将其发送到Java中的特定地址?   java如何修复Dagger 2错误“。。。无法提供[…]”?   java Android单选按钮看起来太轻   Android Studio:开发在应用程序之间共享的通用java库