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.10.0.tar.gz
(57.0 kB
view hashes)
Built Distribution
bytecode-0.10.0-py3-none-any.whl
(44.1 kB
view hashes)
Close
Hashes for bytecode-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f492f740789adaa8ea25cd48e855f2d3cd84ac15dc19289251bafe99c8248d6c |
|
MD5 | c8d0d2c9cd70a737142125865b7bf0ef |
|
BLAKE2b-256 | 3b9553a8e386d786fb355dd5f7358888e834c122fc51f2508531aef209a079de |