On 15 May 2012 20:55, Ned Deily <n...@acm.org> wrote: > In article > <c4dc4a8f-52cc-4447-b199-dafcc296e...@e20g2000vbm.googlegroups.com>, > msmucr <msm...@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
This is what I have with system python 2.6: $ cat ~/bin/python_32 #! /bin/bash export VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/python "$@" I use it for wxpython, which only seems to work in 32 bit mode. I can't remember where I found it. Maybe I read the man page? -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list