[Pythonmac-SIG] running Cocoa application from python

Roger Herikstad roger.herikstad at gmail.com
Fri Jun 6 07:51:14 CEST 2008


Hi all,
  I'm new to the list, so this is my first question. I hope it's not
been extensively covered already; I couldn't find anything while
browsing through the archives. Anyway, 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. Let me just
say first that I'm using matplotlib for plotting smaller subsets of
the data set, which works just fine, but I find it doesn't quite
measure up to the task of efficiently viewing the entire data set. So,
my question is if the list as any good advice as to how to unite these
two tools? My idea for an approach so far is to somehow build the
cocoa application into a bundle, and then load this from a python
C-extension module, but I have not been able to find enough
documentation on how to do this to get me started. I apologise if this
has already been covered, or if there is some obvious source of
information that I've overlooked, but I was hoping to find
documenation/examples on how my approach could be implemented. Failing
that, any other good approach will do. The functionality I'm looking
for is basically being able to send data in the form of numpy arrays
from a running python session to my application, which accepts input
in the form of NSData. In my application, there is a function that
basically takes an NSData object and converts into points that are
then plotted by CoreGraphics drawing routines. I think there should be
a way for me to gain access to this function in python, so that I can
call it on my data, of course with some intermediary data conversion.
Any advice is greatly appreciated.

~ Roger


More information about the Pythonmac-SIG mailing list