def get_port(self):
ports = []
for port in list_ports.comports():
if 'MCP2200' in port[1] or 'USB Serial Device' in port[1] or 'USB Serial Port' in port[1]:
ports.append(port[0])
if ports:
return ports[0]
else:
return None
评论列表
文章目录