Carbon Event Manager (Carbon.CarbonEvt module) - working?

Ned Deily nad at acm.org
Tue May 15 15:55:54 EDT 2012


In article 
<c4dc4a8f-52cc-4447-b199-dafcc296ee9c at e20g2000vbm.googlegroups.com>,
 msmucr <msmucr at gmail.com> wrote:
> i would like to ask you for some information regarding Carbon Event
> Manager ( Carbon.CarbonEvt ) library in Python.
> I need to recieve and work with few Carbon events in my program. I've
> followed some examples on PyObjC site, but wasn't successful. I know,
> that both Carbon library and this Python module is deprecated, but
> frankly i didn't find any usable alternative except of writing of
> something from scratch..
> I ended on basic import of required objects from Carbon.CarbonEvt
> module -
> like "from Carbon.CarbonEvt import RegisterEventHotKey"
> I tried it in Python 2.7.1 (standard distribution in OS X 10.7 Lion)
> and Python 2.6.1 (standard Apple distribution in OS X 10.6).
> Do I have something wrong or is it simply broken and unmaintained now?

You may want to ask OS X specific questions on the macpython mailing 
list (http://www.python.org/community/sigs/current/pythonmac-sig/). The 
main reason that these modules are deprecated (and have been removed in 
Python 3) is because they depend on obsolete APIs in OS X that are only 
available in 32-bit versions.  Apple has made it clear that they will 
not be made available as 64-bit and will eventually go away.  You should 
try to find ways not to use the Carbon model in your applications.  That 
said, you can use these modules, even with the Apple-supplied Pythons in 
OS X 10.6 and 10.7, if you force Python to run in 32-bit-mode.  For 
those Apple-supplied Pythons, see the Apple man page (man 1 python) for 
system Python specific ways to force 32-bit mode persistently.  Another 
way that should work for any OS X universal Python 2.7.x:

    arch -i386 python2.7

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list