一组控制收银机的python绑定
python-cash-register的Python项目详细描述
通用收银机的python绑定,使用XON/XOFF protocol进行串行通信。
支架
如果需要支持,请使用GitHub issue tracker。
贡献
我们喜欢贡献,所以请随时修复错误,改进事情,提供文件。 只需遵循指导原则并提交一份PR即可。
要求
- python 2.7、3.3、3.4和3.5
概述
很快就来。
开始
此示例可能已过时,在稳定版本之前不应使用它 图书馆的:
fromserialimportSerialfromcash_register.models.xditronimportSaremaX1# defines the serial communicationconn=Serial()conn.port='/dev/ttyUSB0'conn.baudrate=9600conn.xonxoff=Trueconn.timeout=1# create a cash register with a serial connection handlerregister=SaremaX1('Shop center',connection=conn)# write a list of productsproducts=[{'description':'Potatoes','price':'2.0','quantity':'3.0',},{'description':'Water','price':'0.50',},]# prepare and send cash register commandsregister.sell_products(products)register.send()
文档
很快就来。
许可证
python-cash-register根据bsd许可证的条款发布。LICENSE文件中的完整详细信息。