def dump_view(view, path): """ The reverse of `ui.load_view()` """ with open(path, "w") as f: json.dump(_view_to_dict(view), f)