• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Transferring data between Python and Cocoa (maybe a newbie question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Transferring data between Python and Cocoa (maybe a newbie question)


  • Subject: Transferring data between Python and Cocoa (maybe a newbie question)
  • From: "Ritesh Nadhani" <email@hidden>
  • Date: Tue, 5 Feb 2008 16:51:29 -0600

Hello

So I started developing my first real life Cocoa app as part of my school work.

My app needs to connect to various servers to fetch similar data. The
issue is that the servers might use different way to get data. Some
use XML-RPC (majority of them are RPC), some use client-server etc.
User can add more server by adding a plugin. We already have bunch of
python scripts that just do that.

I added various Python files implementing functions with similar name. E.g

server1.py
-- def getname():
        // do xml-rpc stuff
        // return data as dictionary

server2.py
-- def getname():
        // do client-server stuff
        // return data as dictionary

Now from Cocoa, I basically want to call these scripts with their
function common function name (which I know is implemented in all
python files) and get the result back.

I did some research on it and I see that we can use pyobjc to do
something like this:
http://www.jonathansaggau.com/blog/2006/07/python_from_objectivec.html

The issue is that PyObjc is bundled only with 10.5 and for other OS X
version we have to install it. My customers have both 10.4 and 10.5
and some even have 10.3 and PyObjc might or might not be installed and
I dont want to make the users install it just for my app.

Other option would be to output the data as XML from Python and parse
it back in Cocoa and build a dictionary out of it.

Are these the only two options or there are other ways to do it? What
do you people suggest.

--
Ritesh
http://www.riteshn.com
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Transferring data between Python and Cocoa (maybe a newbie question)
      • From: Nir Soffer <email@hidden>
  • Prev by Date: Re: NSArrayController & NSTableView selectionIndexes bug
  • Next by Date: Preventing NSTextView sending -setColor: to NSColorPanel?
  • Previous by thread: Core Data Managed Object Context Problem
  • Next by thread: Re: Transferring data between Python and Cocoa (maybe a newbie question)
  • Index(es):
    • Date
    • Thread