plottipy.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PlottiPy 作者: ruddy17 项目源码 文件源码
def refresh(self):
        l = list(list_ports.comports())
        new_ports = [Port(p) for p in l]
        old_ports = self.getPortList()

        # Add new ports to list
        for p in new_ports:
            if p not in self.getPortList():
                self.list_w.addItem(p)

        # Remove disappeared ports from list
        for i in range(self.list_w.count()):
            if(self.list_w.item(i) is not None):
                p = self.list_w.item(i)
                if p not in new_ports:
                    p.close()
                    self.list_w.takeItem(i)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号