Python module to generate and modify bytecode
Project description
bytecode is a Python module to generate and modify bytecode.
bytecode project homepage at GitHub (code, bugs)
Download latest bytecode release at the Python Cheeseshop (PyPI)
Install bytecode: python3 -m pip install bytecode. It requires Python 3.5 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bytecode-0.12.0.tar.gz
(66.2 kB
view hashes)
Built Distribution
bytecode-0.12.0-py3-none-any.whl
(51.4 kB
view hashes)
Close
Hashes for bytecode-0.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40659445900e11cb1f5f09b0e35fe0af2f04661691ca8dc0b505f7bd3d8b8959 |
|
MD5 | c3dfe981a0ea0d234194cb88828ee1b4 |
|
BLAKE2b-256 | 77187d994c036581b4dac6c9612d75dd120565a55806d57fa9842ccde8fa03cc |