> I was searching for a way to construct a new module > from it's file's compiled bytecode (just read() the "*.pyc" file), import marshal, imp f = open("foo.pyc") f.seek(8) code = marshal.load(f) f.close() foo = imp.new_module("foo") exec code in foo.__dict__ --Guido van Rossum (home page: http://www.python.org/~guido/)