import re with open('web_ui/templates/reconciliation.html', 'r', encoding='utf-8') as f: content = f.read() # Replace activeTab content = content.replace("activeTab: 'unmatched'", "activeTab: 'official'") # Replace the HTML for Tabs tabs_start = '' tabs_end = '' start_idx = content.find(tabs_start) end_idx = content.find(tabs_end, start_idx) + len(tabs_end) if start_idx != -1 and end_idx != -1: new_tabs = """ 工单发料明细
' start_idx = content.find(tabs_start) end_idx = content.find(tabs_ti start_idx = content.find(tabs