Skip to main content
Help us improve Python packaging – donate today!

Python module to generate and modify bytecode

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.

Install bytecode: python3 -m pip install 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)

Release history Release notifications

History Node

0.7.0

History Node

0.6.0

This version
History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

History Node

0.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
bytecode-0.5-py3-none-any.whl (35.1 kB) Copy SHA256 hash SHA256 Wheel py3 Jan 5, 2017
bytecode-0.5.tar.gz (45.1 kB) Copy SHA256 hash SHA256 Source None Jan 5, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page