> Or better yet, save the compiled .pyc byte-code string.
> Printed from python, it should need little editing to
> turn into a C string literal - they both use the same
> \000 escape convention.
Check out Demo/scripts/filter.py -- it's all there, if a little rough.
It indeed saves the code objects in the same form (almost) as .pyc
files -- in fact the marshal module was extended with the facility to
write to strings in order to allow this kind of functionality...
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>