def compileAndWrite(in_path, out_path, compile_func):
#print(stdlib_comp, file=sys.stderr)
with open(in_path) as f:
co = compile_func(f.read(), in_path, 'exec')
#print(co, file=sys.stderr)
h = getPycHeader(in_path)
with open(out_path, 'w') as out_f:
out_f.write(h)
s = marshal.dumps(co)
#m = hashlib.md5()
#m.update(s)
#print(m.hexdigest(), file=sys.stderr)
out_f.write(s)
评论列表
文章目录