推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
billgreen1
V2EX  ›  Python

如何通过 co_code 反编译成 python source code?

  •  
  •   billgreen1 · Jul 3, 2016 · 3861 views
    This topic created in 3744 days ago, the information mentioned may be changed or developed.
    背景:
    网上 python 平台,在线环境,一直想知道某个函数是怎么实现的。
    平台限制了 python package 的使用,所以 dis , inspect ,等都是不能用的。

    但是可以通过 func.__code__.co_code 获取编译了的 byte string.

    想问下可以通过这个 byte string 反编译成 python 的 source code 嘛。
    1 replies  •  2016-07-03 14:20:22 +08:00
    shyling
        1
    shyling  
       Jul 3, 2016 via iPad
    在其他环境里 dis.dis(func.__code__.co_code)😉
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   762 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:00 · PVG 05:00 · LAX 14:00 · JFK 17:00
    ♥ Do have faith in what you're doing.