开发者

Tkinter and detection of USB devices

开发者 https://www.devze.com 2023-02-19 22:58 出处:网络
I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve thi开发者_运维问答s purpose. However, I don\'t know how to run USB detection services alongside the

I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve thi开发者_运维问答s purpose. However, I don't know how to run USB detection services alongside the Tkinter main loop. Is this possible?


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.


Might I suggest that instead of trying to constantly monitor the presence of a USB device you include a search or refresh button that will check just once.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号