import re with open( r'D:\资料\03-项目开发\wecom_it_smart_desk\backend\app\api\auth_qrcode.py', 'r', encoding='utf-8', ) as f: content = f.read() match = re.search(r'html = f"""(.+?)"""', content, re.DOTALL) if match: html = match.group(1) print('HTML length:', len(html)) out_path = r'D:\资料\03-项目开发\wecom_it_smart_desk\tmp_scan_html.html' with open(out_path, 'w', encoding='utf-8') as out: out.write(html) print('Saved to', out_path) else: print('HTML template not found')