清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
import re code_file = open('test.c','r') code_content = code_file.read() code_content_temp = re.sub(r'((?<=\n)|^)[ \t]*\/\*.*?\*\/\n?|\/\*.*?\*\/|((?<=\n)|^)[ \t]*\/\/[^\n]*\n|\/\/[^\n]*','',code_content) print(code_content_temp)