在OSX 10.6.3上的Python2.6中找不到Evt.TickCount() [英] Evt.TickCount() not found with Python2.6 on OSX 10.6.3

查看:113
本文介绍了在OSX 10.6.3上的Python2.6中找不到Evt.TickCount()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Python2.6,Evt模块(来自Carbon导入Evt)似乎没有响应OSX上的TickCount().但是Python2.5很好:

With Python2.6, the Evt module (from Carbon import Evt) does not have seem to respond to TickCount() on OSX. But Python2.5 is fine:

from Carbon import Evt
s = Evt.TickCount()

在Python2.5上,我得到一个返回的整数.在Python2.6上,我得到:

On Python2.5 I get a returned integer. On Python2.6 I get:

AttributeError: 'module' object has no attribute 'TickCount'

这是在雪豹上.是否需要在OSX上更新某些库以允许TickCount()工作?由于使用py2app,我实际上遇到了这个问题.

This is on Snow Leopard. Is there some library that needs to be updated on OSX to allow for TickCount() to work? I'm actually having this problem due to using py2app.

更新巴里的答案: 问题在于py2app创建的应用程序在启动时会给我:

Update for Barry's answer: The problem is that the application that py2app creates, when launched, gives me:

  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的解决方案.

I added VERSIONER_PYTHON_PREFER_32_BIT=yes to my .bash_profile, but the app that py2app creates still has the same problem. The python interpreter, however is happy with the 32-bit fix. But still need a solution to py2app.

推荐答案

由于损坏的代码仅用于argv仿真,因此我可以通过禁用argv仿真来使我的应用正常工作.可以通过将py2app OPTIONS哈希中的'argv_emulation'键设置为False来完成.

Since the broken code was only being used for argv emulation, I was able to get my app working by disabling argv emulation. This can be done by setting the 'argv_emulation' key in the py2app OPTIONS hash to False.

示例:

APP = ['MyApp.py']
OPTIONS = { 
   'argv_emulation': False,
   ...
}

setup(
    app=APP,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

这篇关于在OSX 10.6.3上的Python2.6中找不到Evt.TickCount()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆