Skip to main content

Python module to generate and modify bytecode (Temporary CoZ Fork)

Project description

Latest release on the Python Cheeseshop (PyPI) Build status of bytecode on Travis CI Code coverage of bytecode on codecov.io

bytecode is a Python module to generate and modify bytecode.

This is a fork of https://github.com/vstinner/bytecode

It will be removed from Pypi once the original is deployed there.

Install bytecode: python3 -m pip install coz_bytecode. It requires Python 3.4 or newer.

Example executing print('Hello World!'):

from bytecode import Instr, Bytecode

bytecode = Bytecode([Instr("LOAD_NAME", 'print'),
                     Instr("LOAD_CONST", 'Hello World!'),
                     Instr("CALL_FUNCTION", 1),
                     Instr("POP_TOP"),
                     Instr("LOAD_CONST", None),
                     Instr("RETURN_VALUE")])
code = bytecode.to_code()
exec(code)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for coz-bytecode, version 0.5.1
Filename, size File type Python version Upload date Hashes
Filename, size coz_bytecode-0.5.1-py3-none-any.whl (39.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size coz_bytecode-0.5.1.tar.gz (49.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page