Skip to main content

Python module to generate and modify bytecode

Project description

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.3.tar.gz (41.6 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.3-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bytecode-0.3.tar.gz
Algorithm Hash digest
SHA256 7d633048b774a6f085baa079f81002f008cd8695c509435537a39580cb755e4b
MD5 6708f25bac2db34077197c8952f8b806
BLAKE2b-256 cf68403e0225ba700669f5a77334b1c86266004204c090c815a5697c4f042db6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bytecode-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06aa78cd749c623157b23ed21c1caf738d5c7ed71a1d2bb0bd706524507df388
MD5 a1843ac9efd79447df00186360109886
BLAKE2b-256 26027d84a30c347c7d2a95ec4386a4af64d834d0237eebbffb357328f76aefdd

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