先上代码: #!/usr/bin/env python3 # _*_ coding: utf-8 _*_ from xml.dom.minidom import Document def readFile(filename, lines): with open(filename, 'r') as f: for line in f: line = line.rstrip(' \n') if line.startswith('//') or len(line) == 0: continue line…