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.6 or newer. The latest release that supports Python 3.5 is 0.12.0. For Python 2.7 support, have a look at dead-bytecode instead.
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.13.0.tar.gz
(68.2 kB
view hashes)
Built Distribution
bytecode-0.13.0-py3-none-any.whl
(53.4 kB
view hashes)
Close
Hashes for bytecode-0.13.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e69f92e7d27f99d5d7d76e6a824bd3d9ff857c72b59927aaf87e1a620f67fe50 |
|
MD5 | 72a7aa5569d05aabedc6ea6fb63527f6 |
|
BLAKE2b-256 | 1a4e13b188b68f08369733e82eb62e1b095c18a00491f350ef6b0eca38cac216 |