# -*- coding: utf-8 -*-
import io
P = r"D:/work buddy/2026-11-05-14-15-52/index_main.html"
s = io.open(P, encoding="utf-8").read()
rows = []
def A(school, college, en, cn, deg, url, disc):
    rows.append([school, college, en, cn, deg, url, disc])

# ===== CMU Heinz College =====
H = "Heinz 信息系统与公共政策学院"
h = "https://www.heinz.cmu.edu/programs/"
A("cmu",H,"Master of Information Systems Management","信息系统管理硕士","MISM",h+"information-systems-management-master","cs")
A("cmu",H,"MS in Artificial Intelligence Systems Management","人工智能系统管理","MS",h+"artificial-intelligence-masters","cs")
A("cmu",H,"MS in Technology and Artificial Intelligence Leadership","技术与人工智能领导力","MS",h+"technology-and-ai-leadership-master","cs")
A("cmu",H,"MS in Information Security Policy and Management","信息安全政策与管理","MS",h+"information-security-policy-management-master","cs")
A("cmu",H,"MS in Public Policy and Management","公共政策与管理","MS",h+"public-policy-management-master","soc")
A("cmu",H,"Master of Public Management","公共管理硕士","MPM",h+"public-management-master","soc")
A("cmu",H,"MS in Health Care Analytics & Information Technology","医疗分析信息技术","MS",h+"health-care-analytics-master","med")
A("cmu",H,"Master of Medical Management for Physicians","医师医疗管理硕士","MMM",h+"medical-management-master","med")
A("cmu",H,"Master of Arts Management","艺术管理硕士","MAM",h+"arts-management-master","art")
A("cmu",H,"Master of Entertainment Industry Management","娱乐产业管理硕士","MEIM",h+"entertainment-industry-management-master","art")

# ===== CMU SCS =====
C = "计算机学院 SCS"
A("cmu",C+" · 计算机科学系","Master of Science in Computer Science","计算机科学硕士","MSCS","https://www.csd.cmu.edu/education/master/index.html","cs")
A("cmu",C+" · 人机交互研究所","Master of Human-Computer Interaction","人机交互硕士","MHCI","https://www.hcii.cmu.edu/academics/mhci","cs")
A("cmu",C+" · 人机交互研究所","Master of Science in Learning Engineering","学习工程","MS","https://metals.hcii.cmu.edu/","edu")
A("cmu",C+" · 人机交互研究所","Master of Science in Product Management","产品管理","MS","https://www.cmu.edu/tepper/programs/master-product-management/index.html","biz")
A("cmu",C+" · 语言技术研究所","Master of Computational Data Science","计算数据科学","MCDS","https://lti.cmu.edu/academics/masters-programs/mcds.html","cs")
A("cmu",C+" · 语言技术研究所","MS in Artificial Intelligence and Innovation","人工智能与创新","MS","https://lti.cmu.edu/academics/masters-programs/msaii.html","cs")
A("cmu",C+" · 语言技术研究所","MS in Intelligent Information Systems","智能信息系统","MS","https://lti.cmu.edu/academics/masters-programs/miis.html","cs")
A("cmu",C+" · 语言技术研究所","MS in Language Technologies","语言技术","MS","https://lti.cmu.edu/academics/masters-programs/mlt.html","cs")
A("cmu",C+" · 机器学习系","Master of Science in Machine Learning","机器学习","MS","https://ml.cmu.edu/academics/primary-ms-machine-learning-masters","cs")
A("cmu",C+" · 计算生物学系","MS in Automated Science: Biological Experimentation","自动化科学（生物实验）","MS","http://msas.cbd.cmu.edu/","sci")
A("cmu",C+" · 计算生物学系","MS in Computational Biology","计算生物学","MS","http://www.cmu.edu/bio/graduate/prospective_students/ms_comp_bio/","sci")
A("cmu",C+" · 机器人研究所","MS in Computer Vision","计算机视觉","MSCV","http://www.ri.cmu.edu/MSCV","cs")
A("cmu",C+" · 机器人研究所","MS in Robotics","机器人学","MS","https://www.ri.cmu.edu/ri_static_content.html?menu_id=322","eng")
A("cmu",C+" · 机器人研究所","Master's in Robotic Systems Development","机器人系统开发","MRSD","https://mrsd.ri.cmu.edu/","eng")
A("cmu",C+" · 软件与社会系统系","Master's in Privacy Engineering and AI Governance","隐私工程与 AI 治理","MS","https://privacy.cs.cmu.edu/masters/index.html","cs")
A("cmu",C+" · 软件与社会系统系","Master's in Privacy Technology and AI Governance","隐私技术与 AI 治理","MS","https://privacy.cs.cmu.edu/masters/index.html","cs")
A("cmu",C+" · 软件与社会系统系","Master of Software Engineering","软件工程","MSE","https://mse.isri.cmu.edu/applicants/mse-as/index.html","cs")
A("cmu",C+" · 软件与社会系统系","MS in Software Engineering (Online)","软件工程（在线）","MS","https://mse.isri.cmu.edu/applicants/mse-as-online/index.html","cs")

# ===== CMU Tepper =====
T = "Tepper 商学院"
A("cmu",T,"Master of Business Administration","工商管理硕士","MBA","https://www.cmu.edu/tepper/programs/mba","biz")
A("cmu",T,"MS in Business Analytics","商业分析","MSBA","https://www.cmu.edu/tepper/programs/master-business-analytics","biz")
A("cmu",T,"MS in Management","管理学","MSM","https://www.cmu.edu/tepper/programs/master-science-management","biz")
A("cmu",T,"MS in Computational Finance","计算金融","MSCF","https://www.cmu.edu/mscf/","biz")
A("cmu",T,"Ph.D. Program","商学博士","PhD","https://www.cmu.edu/tepper/programs/phd","biz")

def q(x): return '"' + str(x).replace('\\','\\\\').replace('"','\\"') + '"'
block = "\n".join("[" + ", ".join(q(c) for c in r) + "]," for r in rows) + "\n"
anchor = "];\nconst DOCDEG"
assert anchor in s
s = s.replace(anchor, block + "];\nconst DOCDEG", 1)
io.open(P,"w",encoding="utf-8").write(s)
print("inserted", len(rows))
