Utilities to work with bytecode.
Project description
bytecomp
Utilities for working with bytecode.
Magic:
import bytecomp
bytecomp.MAGIC # Returns Magic
Pyc Headers:
import bytecomp
bytecomp.HEADER # Returns .pyc Header
bytecomp.generate_header() # Also returns a .pyc header
Compiling Bytecode:
import bytecomp
code_object = compile("""print('Hello!')""",'file','exec')
pyc = open('compiled.pyc','wb')
pyc.write(bytecomp.compile_object(code_object))
pyc.close()
# Above code generates a working .pyc file from a code object.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bytecomp-1.0.0.tar.gz
(2.1 kB
view hashes)