with open('src/gui_2.py', 'r', encoding='utf-8', newline='') as f: content = f.read() old = ''' imgui.end_popup() if self.show_script_output:''' new = ''' imgui.end_popup() # Cycle Detected Popup if imgui.begin_popup_modal("Cycle Detected!", None, imgui.WindowFlags_.always_auto_resize)[0]: imgui.text_colored(imgui.ImVec4(1, 0.3, 0.3, 1), "The dependency graph contains a cycle!") imgui.text("Please remove the circular dependency.") if imgui.button("OK"): imgui.close_current_popup() imgui.end_popup() if self.show_script_output:''' content = content.replace(old, new) with open('src/gui_2.py', 'w', encoding='utf-8', newline='') as f: f.write(content) print('Done')