• 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
Re: creating classes on the fly ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >creating classes on the fly ?? (From: Daniel Child <email@hidden>)
 >Re: creating classes on the fly ?? (From: Thomas Engelmeier <email@hidden>)
 >Re: creating classes on the fly ?? (From: Daniel Child <email@hidden>)
 >Re: creating classes on the fly ?? (From: Thomas Engelmeier <email@hidden>)
 >Re: creating classes on the fly ?? (From: "Stefan Arentz" <email@hidden>)
 >Re: creating classes on the fly ?? (From: Daniel Child <email@hidden>)
 >Re: creating classes on the fly ?? (From: Daniel Child <email@hidden>)

  • Prev by Date: Re: Get the CPU architecture of the local m/c
  • Next by Date: Re: creating classes on the fly ??
  • Previous by thread: Re: creating classes on the fly ??
  • Next by thread: Re: creating classes on the fly ??
  • Index(es):
    • Date
    • Thread