[Pythonmac-SIG] running Cocoa application from python

Roger Herikstad roger.herikstad at gmail.com
Fri Jun 6 16:42:34 CEST 2008


Hi,
 Thanks for your quick reply. I'm leaning towards case 2 i) as it
seems the simpler. You are quite right in that speed is an issue for
me, so I'll have to do some testing to see what suits my needs. I
guess as long as I have access to the python interpreter, it might as
well be from within the application itself. Thanks again!

~ Roger

On Fri, Jun 6, 2008 at 9:01 PM, has <hengist.podd at virgin.net> wrote:
>
> Roger Herikstad wrote:
>
>> I'm developing a Cocoa
>> application for plotting relatively large data sets (10000-100 000
>> points) containing waveforms recorded from electrophysiological
>> experiments. The program allows for efficient panning through the
>> data, zooming, as well as other features. Since I am doing most of my
>> analysis in python, the idea occurred to me to try creating an
>> interface of sort to my Cocoa application using python.
>
> Options:
>
> 1. Use IPC (e.g. Apple events, Distributed Objects) to communicate with your
> application from a separate Python process.
>
>
> 2. Embed a Python interpreter in your application and use PyObjC to interact
> with Cocoa objects from Python and vice-versa. (This topic came up last
> month if you check the archives.) Two variations on this:
>
> i. embed the interpreter directly in your application (simpler)
>
> ii. create an NSBundle-based plugin API (c.f. VoodooPad) which takes a
> suitably packaged Python interpreter or anything else you might want to add
> (more flexible).
>
>
> 3. Package your application's Model layer as a self-contained framework (as
> you suggest) which a Python process can import via PyObjC.
>
>
> Since you're dealing with fairly large amounts of data and speed is
> presumably a requirement, that probably eliminates #1. Of #2 and #3, #2 is
> probably the easier to implement as it can easily be added to an existing
> application without having to do lots of refactoring to break out the Model
> as an independent framework. #3 might be worth considering if you'd have
> other uses for such a framework, however.
>
> HTH
>
> has
> --
> Control AppleScriptable applications from Python, Ruby and ObjC:
> http://appscript.sourceforge.net
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>


More information about the Pythonmac-SIG mailing list