Re: creating classes on the fly ??
Re: creating classes on the fly ??
- Subject: Re: creating classes on the fly ??
- From: Andrew Farmer <email@hidden>
- Date: Wed, 26 Sep 2007 12:48:58 -0700
On 26 Sep 07, at 10:50, Daniel Child wrote:
Sorry for basic questions, but I've never looked into using an
alternate language like Python. Would I be able to make C-language
Carbon calls as well, all from within the same project?
Yes. If you've got Python 2.5*, you get a really neat module called
'ctypes' which lets you load arbitrary frameworks and use functions
from them:
>> import ctypes
>> Carbon = ctypes.CDLL('/System/Library/Carbon.framework/Carbon')
>> Carbon.SysBeep(0)
Setting up arguments and return types takes a little legwork, but all
the basics are there.
* ctypes is available under earlier versions of Python as well,
actually - it's just not part of the standard distribution until 2.5.
_______________________________________________
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