Exposing object model in Python?

Jason Whitlark jwhitlark at attbi.com
Tue Jul 1 00:05:19 EDT 2003


"Fredrik Lundh" <fredrik at pythonware.com> wrote in message news:<mailman.1056722085.11922.python-list at python.org>...
>     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)
> 
> </F>

Excellent, I was interested in that too.

Ok, here's something similar I've struggled with...  How do you
provide a macro recorder?  I have some idea how to just play back a
sequence of actions, (just store signals in a list, then fire them in
order), but how do you turn that back into python code, like in Word
VB?




More information about the Python-list mailing list