![](/img/trans.png)
[英]“AttributeError: ‘NoneType’ object has no attribute write” on windows cx_freeze
[英]cx_Freeze + curses: 'NoneType' object has no attribute 'fileno'
我已經使用cx_Freeze實用工具從以下python腳本生成了一個exe
文件:
from curses import wrapper
def main(stdscr):
pass
wrapper(main)
但是當我運行它時,它給了我一個錯誤:
AttributeError: 'NoneType' object has no attribute 'fileno'
完整錯誤:
問題是,當我從腳本中排除wrapper(main)
時,exe可以正常工作。
我可以使用以下安裝腳本在Windows 7上使用python 3.6和cx_Freeze
5.1.1從您的curses_example.py
python腳本中生成可運行的可執行文件:
from cx_Freeze import setup, Executable
executables = [Executable('curses_example.py')]
setup(name='curses_example',
version='0.1',
description='Sample cx_Freeze script',
executables=executables)
為了使curses
起作用,我首先需要使用以下命令安裝windows-curses
pip install windows-curses
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.