【发布时间】:2019-07-22 05:39:07
【问题描述】:
我已经从以下 python 脚本使用cx_Freeze 实用程序生成了一个exe 文件:
from curses import wrapper
def main(stdscr):
pass
wrapper(main)
但是当我运行它时,它给了我一个错误:
AttributeError: 'NoneType' object has no attribute 'fileno'
完全错误:
问题是当我从脚本中排除 wrapper(main) 时,exe 可以正常工作。
【问题讨论】:
-
听起来像是 cx_freeze 的限制(
fileno是标准的 C 运行时函数)。 -
能否分享您的安装脚本?您在哪个 (Windows) 平台上工作,您是如何让
curses在其上工作的(标准 Python 安装中包含的curses模块在 Windows 7 上不起作用)。