configurator.py 文件源码

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

项目:Enrich2 作者: FowlerLab 项目源码 文件源码
def menu_save(self):
        if len(self.cfg_file_name.get()) == 0:
            self.menu_saveas()
        elif self.root_element is None:
            tkMessageBox.showwarning(None, "Cannot save empty configuration.")
        else:
            try:
                with open(self.cfg_file_name.get(), "w") as handle:
                    write_json(self.root_element.serialize(), handle)
            except IOError:
                tkMessageBox.showerror(None, "Failed to save config file.")
            else:
                tkMessageBox.showinfo(None, "Save successful:\n{}".format(self.cfg_file_name.get()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号