在 Python2.6 中,Evt 模块(来自 Carbon 导入 Evt)似乎没有响应 OSX 上的 TickCount()。但是Python2.5很好:
from Carbon import Evt
s = Evt.TickCount()
在 Python2.5 上,我得到一个返回的整数。在 Python2.6 上,我得到:
AttributeError: 'module' object has no attribute 'TickCount'
这是在雪豹上。是否有一些库需要在 OSX 上更新以允许 TickCount() 工作?由于使用py2app,我实际上遇到了这个问题。
Barry 的回答更新: 问题是 py2app 创建的应用程序在启动时给了我:
File "/Users/cybertoast/Projects/scripts/dist/fixcatalystlibs.app/Contents/Resources/__boot__.py", line 40, in mainloop
[0x0-0x913913].org.pythonmac.unspecified.fixcatalystlibs[11722] stoptime = Evt.TickCount() + timeout
[0x0-0x913913].org.pythonmac.unspecified.fixcatalystlibs[11722] AttributeError: 'module' object has no attribute 'TickCount'
我在我的 .bash_profile 中添加了 VERSIONER_PYTHON_PREFER_32_BIT=yes,但是 py2app 创建的应用程序仍然存在同样的问题。然而,python 解释器对 32 位修复很满意。但是仍然需要py2app的解决方案。