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.9.0.tar.gz (55.8 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.9.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bytecode-0.9.0.tar.gz
  • Upload date:
  • Size: 55.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for bytecode-0.9.0.tar.gz
Algorithm Hash digest
SHA256 eaf65fde702a8740c67c9470168c0e095925db269af3cb4dfe78cba73d47fd63
MD5 0a2efca22cb1defe1b1f015d4302415a
BLAKE2b-256 e3f41dba8cd543268b13528ffba35dcac3ddf9da44f3a15cec18d01fea10da50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bytecode-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for bytecode-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08eab84ca01bc16e7f5c2f6f7550ab9a98ea5a5839cba8be589e16ffedfe9c96
MD5 8098a012542ed623af7a2a823b9c6b76
BLAKE2b-256 908de198bc7be0d08c6e5ca8200453232644d888fe476d35e69ea1f6ebd980a4

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