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.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
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.11.0.tar.gz
(58.8 kB
view hashes)
Built Distribution
bytecode-0.11.0-py3-none-any.whl
(46.1 kB
view hashes)
Close
Hashes for bytecode-0.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6beee115babab0c7eb99ab807dead245133b8434d502ba7b6b3e7032426d23fb |
|
MD5 | 54c339922ea04cf641ace28cac2b0330 |
|
BLAKE2b-256 | b63313adc735b6566a7dd24723ac92313e744e802799c8cfdd3e49b1c1ec1fb8 |