在Windows 10中查找USB的循环python函数
好的,我正在尝试制作一个python脚本,它将查找一个名为在Windows 10中查找USB的循环python函数,python,Python,好的,我正在尝试制作一个python脚本,它将查找一个名为MyUSB的USB驱动器,程序将每2秒检查一次。有人建议我使用什么代码吗?我曾在其中检查usb检测 import os a=os.popen("wmic logicaldisk get description") dev_list=a.read() if "Removable" in dev_list: print("Pendrive Detected") else: print("Pendrive is not
MyUSB
的USB驱动器,程序将每2秒检查一次。有人建议我使用什么代码吗?我曾在其中检查usb检测
import os
a=os.popen("wmic logicaldisk get description")
dev_list=a.read()
if "Removable" in dev_list:
print("Pendrive Detected")
else:
print("Pendrive is not there")
但它会检测所有可移动驱动器。欢迎使用。请阅读以下内容:。若要在此处发布,您应该尝试解决您的问题,并在途中获得帮助。我建议你先开始使用谷歌,我认为大多数ppl在不到1分钟的时间内就可以找到代码片段并开始尝试。我投票将这个问题作为离题回答,因为这不是一个代码编写服务。