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

Uploaded Source

Built Distribution

bytecode-0.10.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bytecode-0.10.0.tar.gz
  • Upload date:
  • Size: 57.0 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.10.0.tar.gz
Algorithm Hash digest
SHA256 f78a312880173f1d20aef2eceb8eb959dc6c2167966b757fef201b8af839f802
MD5 e4711be0e6d48bc16e323b6f1e7fbc8d
BLAKE2b-256 26a23709daaee2677e938e13cad3998936c25e0d194e9e6c9f1861863c4bb64f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: bytecode-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 44.1 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.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f492f740789adaa8ea25cd48e855f2d3cd84ac15dc19289251bafe99c8248d6c
MD5 c8d0d2c9cd70a737142125865b7bf0ef
BLAKE2b-256 3b9553a8e386d786fb355dd5f7358888e834c122fc51f2508531aef209a079de

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