Python code persistance

Samuel Bronson neaesten at myrealbox.com
Thu Aug 29 03:48:45 CEST 2002


Andrés wrote:
> I posted a reply earlier but maybe it got lost or its just delayed,
> anyways I improved the code. Note that pickle or marshall don't
> support persistence of code objects . the py_compile.compile may also
> work but it works with files only and not strings.

How do you explain this, then?
--SamB

# Don't worry, I won't nuke your system!
import marshal, new

new.function(marshal.loads('''eJxLZgACRgZmhmJ+IKOekaGeiSGFkcHdI4WBIViDCS
jmV8wHJD1Sc3LyFXwTi4ozEnMUNUC60IhidiBhU1ySkplnV8wIZCcyMhSDDGBmBADk7w6R'''
.decode('base64').decode('zlib')), {})()




More information about the Python-list mailing list