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

Uploaded Source

Built Distribution

bytecode-0.5-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bytecode-0.5.tar.gz
Algorithm Hash digest
SHA256 a9178198a87148102cbf15bb26c75533a7fcff517e8df7f3eb8a505d9ffe08ea
MD5 7d562fcb0bb50e1567e7241bdfed9d2c
BLAKE2b-256 3f3838b03d8d00e3ed607189561f9591c9a469b787155cc1d05172a35253abf2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for bytecode-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 70564b6d6403471d940eac5aef6c9cb23774763a07235d106d60a1249a5726ac
MD5 c76c7a89d44d266a882c423adda0ee7c
BLAKE2b-256 a34d7bfb338936203acdedeaeeda1d1d295585834054dda5a5083bb95b70fcde

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