import re,html,sys,glob,os out=open('reference/scratch/t386.txt','w') stats={} for f in sorted(glob.glob('reference/spritesmind/t386-*.html')): s=open(f,encoding='utf-8',errors='replace').read() posts=re.split(r'
','\n[CODE]\n',txt,flags=re.S); txt=txt.replace('','\n[/CODE]\n')
txt=re.sub(r'