"""替换 board-coach.html 中的助教卡片区域为新版本""" import re filepath = "docs/h5_ui/pages/board-coach.html" with open(filepath, "r", encoding="utf-8") as f: content = f.read() # 定位旧的助教列表区域 old_start = " " old_end_marker = " " start_idx = content.index(old_start) end_idx = content.index(old_end_marker) new_coach_section = '''
小燕 星级 中🎱
星级 → 王牌 86.2h / 100h
💖 王先生💖 李女士💛 赵总
定档 86.2h | 折前 92.0h
泡芙 高级 斯诺克
高级 → 星级 72.5h / 80h
💖 陈先生💛 刘女士💛 黄总
定档 72.5h | 折前 78.0h
A
Amy 星级 中🎱 斯诺克
星级 → 王牌 68.0h / 100h
💖 张先生💛 周女士💛 吴总
定档 68.0h | 折前 72.5h
M
Mia 中级 麻将
中级 → 高级 55.0h / 60h
💛 赵先生💛 吴女士💛 孙总
定档 55.0h
糖糖 初级 中🎱
初级 → 中级 42.0h / 40h ✅
💛 钱先生💛 孙女士💛 周总
定档 42.0h | 折前 45.0h
露露 中级 团建
中级 → 高级 38.0h / 60h
💛 郑先生💛 冯女士💛 陈总
定档 38.0h
''' content = content[:start_idx] + new_coach_section + content[end_idx:] with open(filepath, "w", encoding="utf-8") as f: f.write(content) print("OK — coach cards replaced successfully")