Re: .py source in interpreter exectuable?
Sat, 18 Jun 1994 10:51:04 +0200

> If I were shipping a product consisting of a python interpreter, some
> custom C modules, and a bunch of .py source modules, I'd like to be
> able to bind them all in one big happy executable to save my users all
> the installation hassles involved with $PYTHONPATH and such.

> 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/ -- 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 <>
URL: <>