Tkinter and detection of USB devices

2019-05-23 08:17发布

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?

2条回答
相关推荐>>
2楼-- · 2019-05-23 09:03

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.

查看更多
地球回转人心会变
3楼-- · 2019-05-23 09:06

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.

查看更多
登录 后发表回答