filebrowser.py 文件源码

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

项目:stomatameasurer 作者: TeamMacLean 项目源码 文件源码
def _update(self, box):

        def on_click(b):
            if b.description == 'up one level':
                self.path = os.path.split(self.path)[0]
            else:
                self.path = self.path + "/" + b.description
            self._update_files()
            self._update(box)

        buttons = []
        # if self.files:
        button = widgets.Button(description='up one level', background_color='#aaaaaa')
        button.on_click(on_click)
        buttons.append(button)
        for f in self.dirs:
            button = widgets.Button(description=f, background_color='#d0d0ff')
            button.on_click(on_click)
            buttons.append(button)
        for f in self.files:
            button = widgets.Button(description=f)
            button.on_click(on_click)
            buttons.append(button)
        box.children = tuple([widgets.HTML("You have selected: <h3>%s</h3>" % (self.path,))] + buttons)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号