Cx_freeze错误丢失了sys.stdin

Ant*_*ony 9 cx-freeze python-3.x

这是困扰我一段时间的问题.我查了一下,但没有找到答案.我也试过自己弄清楚,但没有成功.每当我创建并尝试使用其中的input()函数冻结程序时,我都会得到相同的错误. 在此输入图像描述

我试过运行.exein命令提示符,但我得到了同样的错误.我的setup.py脚本如下.

import cx_Freeze, sys
from cx_Freeze import setup, Executable

exe=Executable(
     script="input.py",
     base="Win32Gui",

     )
includefiles=[]
includes=["re"]
excludes=[]
packages=[]
setup(

     version = "0",
     description = "No Description",
     author = "Anthony",
     name = "0",
     options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
     executables = [exe]
     )
Run Code Online (Sandbox Code Playgroud)

我的简短测试脚本:

import sys,re
input('input')
Run Code Online (Sandbox Code Playgroud)

这是我可以解决的问题,还是我必须在没有该input()功能的情况下工作?我在Windows 7上使用Python 3.2,使用相应的cx_freeze版本.提前致谢.

Tho*_*s K 13

Win32GUI基础是为Windows GUI程序设计的 - 即它们在Windows中运行,而不是在命令提示符下运行.所以没有标准输入,你不能使用input().

如果要创建控制台程序,请设置base='Console'(或者base=None,因为控制台是默认设置).