Skip to main content

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)

Project details


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.6.0.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bytecode-0.6.0-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file bytecode-0.6.0.tar.gz.

File metadata

  • Download URL: bytecode-0.6.0.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bytecode-0.6.0.tar.gz
Algorithm Hash digest
SHA256 764954b1735f271ad3bf0897258d6c367668bb9a76f78e9734019fb3bb615aab
MD5 a26b6b48ecd2530aeea52d6edcdb9686
BLAKE2b-256 a2cc6ec73730b08d1c5463b0f6f569f5c527117ee93291da773a1348093f55e0

See more details on using hashes here.

File details

Details for the file bytecode-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bytecode-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b84102dc9b2787332ed145b428fb3468dbbe1e9646a3dc3442bbc2fcc60fda31
MD5 933d3633bf40fa16d8ed248d85072dd8
BLAKE2b-256 af7b1651b3d04497e687137072dbbb801a41c92ac589e2f623cdf369e9f0258d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page