window.py 文件源码

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

项目:Quiver 作者: DeflatedPickle 项目源码 文件源码
def close(self):
        if self.directory_real:
            # print(self.directory, self.directory_real)
            with zipfile.ZipFile(self.directory_real, "w") as z:
                for root, dirs, files in os.walk(self.directory.replace("\\", "/"), topdown=True):
                    new_root = root.replace("\\", "/").split("/")
                    # print(root, dirs, files)
                    for name in files:
                        z.write(os.path.join(root, name), "/".join(new_root[new_root.index(
                            self.directory.replace("\\", "/").split("/")[-1]) + 1:]) + "/" + name)

            self.d.cleanup()

        self.destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号