Teleinfo python库
pyticcom的Python项目详细描述
pyticcom-EDF电话信息Python库
此库允许您使用串行端口设备(USBTICLCV2)检索teleinfo。在
示例
import asyncio
from pyticcom import Teleinfo, Mode
from scanner import ComScanner
scanner = ComScanner()
serials = scanner.scan()
for serial in serials:
print(serial.device)
async def main():
with Teleinfo('/dev/USB0', mode=Mode.HISTORY) as teleinfo:
while True:
frame = await teleinfo.read_frame()
print("{} groups found".format(len(frame.groups)))
for group in frame.groups:
print(group)
await asyncio.sleep(1)
loop = asyncio.get_event_loop()
result = loop.run_until_complete(main())
- 项目
标签: