If you're using the PyObjC templates from Xcode, and if your objc code and python code are in the same program/project, you can get to your ObjC class(es) simply by importing Foundation in the python module -- your class and methods will be found at runtime via PyObjC's introspection mechanism.  Easy!

If you're not already using one of the Xcode PyObjC templates for your project, you could: 
  a) move your existing python code into a new project based on those templates, 
  b) Compile an app containing your classes that will use the Python API to load and run your python code-- which is pretty much what the 'main.m' file does in the Xcode PyObjc  templates, or 
  c) compile your classes into a plugin/bundle and use the objc.loadBundle() method to load that code. 
(there are other solutions, but those are the ones that come to mind right off)

HTH,
-mv

On Sat, Feb 21, 2009 at 3:40 PM, Yi Qiang <yqiang@gmail.com> wrote:
Hi,
How do I wrap a single objective-c class so that I can access it from python? I looked at the objc documentation and it has information on how to extract & wrap classes for a framework, using objc.loadBundle(). However, I just have a single class (.m/.h) that I want to be able to access.

Cheers,
Yi

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Pyobjc-dev mailing list
Pyobjc-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev