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

Uploaded Source

Built Distribution

bytecode-0.7.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bytecode-0.7.0.tar.gz
Algorithm Hash digest
SHA256 cc6931151c7f0a542f8cf7619fe1639af3b9529c4678860fa3239397cb0f7de0
MD5 7a2d0589e31e80fc2184f86ddd57f415
BLAKE2b-256 30e3ccf016a3b30ff631550c1aae2be19a4a0592cb6746b54151daf4475cf0a0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for bytecode-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e464004d4a9eeeca987cb4950dba11b827964b6c90cd331c1f20abd2dab3c962
MD5 af691f39fdff0b1eff555fcdacbca7a5
BLAKE2b-256 b81e6ce400200c7392f6f9e7be5f8a6b4cbf0a5b7a132663fb021fc8d781d05a

See more details on using hashes here.

Provenance

Supported by

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