[Pythonmac-SIG] giving an embedded interactive interpreter access to objc & app objects

Michael VanLandingham m.vanland at gmail.com
Sun May 11 03:46:02 CEST 2008


Hi,
I'm working on a (mostly cocoa) application, and want to embed an
interactive interpreter into the app.  I think I have that working, at least
in a Foundation-based test CLI app.  (I'm sure it will be more difficult
outside of the terminal environment).  However, how do I give the
interpreter access to the app's objects?  Is there some way to pass those
objects in, via PyObjC or something else, before calling the
PyRun_InteractiveLoop() function?
Or is there a way that I can take advantage of introspection to gain access
to those objects once I've started the interpreter?

There is pyobjc.inject, which seems to be able to do this kind of
introspection etc, but it's not working for me on Leopard.  Plus, I'd rather
explicitly embed the interpreter, rather than the injecting voodoo.  (I did
try loading the example InjectInterpreter.bundle into my app, but that
didn't work either).

Thank You,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20080510/bc5cfbac/attachment.htm>


More information about the Pythonmac-SIG mailing list