Exposing object model in Python?
Fredrik Lundh
fredrik at pythonware.com
Fri Jun 27 12:10:36 EDT 2003
Steve Holden wrote:
> > > Unfortunately the techniques used are a little too complicated to
> > > describe in a newsgroup posting.
> > >
> > > with-apologies-to-pierre-de-fermat-ly y'rs - steve
> >
> > macrosource = getmacro(macroname)
> > code = compile(macrosource, macroname, "exec")
> > context = {}
> > # populate context with fun things
> > context["app"] = object_representing_my_app
> > exec code in context
> >
> > (add exception handling as necessary)
>
> You just *love* proving me wrong, don't you?
Oh, it's just that my news reader has wider margins.
</F>
More information about the Python-list
mailing list