QuickRouter · 人工操作教材 · 非目标产品 UI / 非模型会话日志

VS Code Copilot Agent 教程 · 配置与操作材料

pyproject.toml

[build-system]
requires = ["setuptools==80.9.0", "wheel==0.45.1"]
build-backend = "setuptools.build_meta"
[project]
name = "qr-textstats-fixture"
version = "0.1.0"
requires-python = ">=3.10"
description = "Original offline tutorial fixture; not for publication"
[project.scripts]
qr-textstats = "qr_textstats.cli:main"
[tool.setuptools.packages.find]
where = ["src"]

src/qr_textstats/cli.py

import argparse,json
from pathlib import Path
def main():
 p=argparse.ArgumentParser(prog='qr-textstats');p.add_argument('path',type=Path);a=p.parse_args()
 text=a.path.read_text(encoding='utf-8');print(json.dumps({'lines':len(text.splitlines()),'characters':len(text),'whitespaceWords':len(text.split())},ensure_ascii=False))
if __name__=='__main__':main()