python bytecodes by hand

Robert Brewer fumanchu at
Wed Aug 25 16:39:47 CEST 2004

Maurice LING wrote:
> I am just wondering about the structure of a pyc (python 
> bytecode) file 
> and has anyone successfully write a functional pyc file by hand?

Yes, they have. Although, generally, you either:

1) write a program to generate the bytecode for you in some non-standard
way, or
2) declare a similar target in Python, grab its bytecode, and tweak it
as needed.

Google for "Python bytecode hack".

Robert Brewer
Amor Ministries
fumanchu at

More information about the Python-list mailing list