var_name, var_value = var_assignment.split('=', 1)
def update_variable(self): selection = self.variable_listbox.curselection() if not selection: messagebox.showwarning("Warning", "No variable selected") return var_name = self.variable_listbox.get(selection[0]) new_value_str = self.value_entry.get(1.0, tk.END).strip() current_type = self.all_variables[var_name]['type'] try: # Convert value based on type if current_type == 'int': new_value = int(new_value_str) elif current_type == 'float': new_value = float(new_value_str) elif current_type == 'bool': new_value = new_value_str.lower() in ('true', '1', 'yes', 'on') elif current_type == 'list': new_value = json.loads(new_value_str) elif current_type == 'dict': new_value = json.loads(new_value_str) else: new_value = new_value_str # Update variable self.all_variables[var_name]['value'] = new_value self.status_var.set(f"Updated var_name = new_value") except Exception as e: messagebox.showerror("Error", f"Failed to convert value: str(e)") renpy save editor
class RenPySaveEditor: def (self, root): self.root = root self.root.title("Ren'Py Save Editor v1.0") self.root.geometry("900x600") var_name, var_value = var_assignment