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.8.0.tar.gz (54.7 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.8.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bytecode-0.8.0.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.8

File hashes

Hashes for bytecode-0.8.0.tar.gz
Algorithm Hash digest
SHA256 c43d5052cbff076bfdf5b0b93ff6c76e461aab628ce47d30637bb200b6b7bb2c
MD5 4608cc0a6ffb98d160f35706fcdf9744
BLAKE2b-256 c9e4d039414448e1c84fb14c32db948474661ce24995484bb4cb35aa3c97673b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bytecode-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.8

File hashes

Hashes for bytecode-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68b1d591c7af0e5c5273e028d3cc0299fbe374dff0cf9149ec7e569be0c573e7
MD5 b1fa7f979680162f09b0d5da3e95f522
BLAKE2b-256 1d1d2c088ffe767b0c59c4a3ba5f932b83a21c6633b0e52039f9d59141293f0d

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