Files
Neo-ZQYY/scripts/ops/_fix_playbook_3b.py
Neo 66c9ae8738 chore: 迁移项目路径 C:\NeoZQYY → C:\Project\NeoZQYY
开发环境从旧虚拟机 (DESKTOP-KGB0K5G) 迁移到新机器 (DESKTOP-D676QDA),
项目目录从 C:\NeoZQYY 变更为 C:\Project\NeoZQYY,
批量替换 126 个文件中的绝对路径引用。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 06:45:29 +08:00

24 lines
838 B
Python

path = 'c:/Project/NeoZQYY/docs/h5_ui/compare/AGENT-PLAYBOOK.md'
with open(path, 'rb') as f:
raw = f.read()
content = raw.decode('utf-8')
# Fix all remaining instances of wrong characters
content = content.replace('\u9501\u70b9\u6cd5', '\u9501\u70b9\u6cd5'.replace('\u9501', '\u9576')) # won't work this way
# Direct string replacements
content = content.replace('\u5207\u6362\u5230\u9501\u70b9\u6cd5', '\u5207\u6362\u5230\u9501\u70b9\u6cd5')
# Just replace all occurrences of the wrong chars
import re
# \u9501 = 锁, \u9576 = 锚
content = content.replace('\u9501\u70b9', '\u9576\u70b9')
with open(path, 'wb') as f:
f.write(content.encode('utf-8'))
# Verify
count = content.count('\u9576\u70b9') # 锚点
remaining = content.count('\u9501\u70b9') # 锁点
print('锚点 count:', count, '| 锁点 remaining:', remaining)