stdlib_compile.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:oil 作者: oilshell 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号