# -*- coding: utf-8 -*- # t08-list.py — 列出 A4 客户管理页面清单 import io, sys, os sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') base = '.scratch/opportunity-bugfix/lanhu-pages' names = sorted(n for n in os.listdir(base) if n.startswith('A4')) for n in names: # 打印页名 + 控件数(从文件头抓「控件: N / 有文本: M」) head = open(os.path.join(base, n), 'r', encoding='utf-8').read(400) meta = '' for ln in head.splitlines(): if ln.startswith('- 控件:'): meta = ln.strip() break print(n, meta) print('TOTAL', len(names))