Tkinter和USB设备检测 [英] Tkinter and detection of USB devices

查看:119
本文介绍了Tkinter和USB设备检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想监视USB设备的存在,并找到了用于此目的的模块(例如PyUSB).但是,我不知道如何与Tkinter主循环一起运行USB检测服务.这可能吗?

I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve this purpose. However, I don't know how to run USB detection services alongside the Tkinter main loop. Is this possible?

推荐答案

在启动tk mainloop之前,启动一些单独的线程来监视USB. 或者,您可以尝试使用tk警报 http://www.pythonware.com/library/tkinter/introduction/x9507-alarm-handlers-and-other.htm 定期检查USB.

Before starting tk mainloop, start some separate thread that will monitor USBs. Or you can try using tk alarms http://www.pythonware.com/library/tkinter/introduction/x9507-alarm-handlers-and-other.htm to periodically check USB.

这篇关于Tkinter和USB设备检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆