5
這是一個困擾了我一段時間的問題。我查過它,但沒有找到答案。我也嘗試瞭解自己,但沒有成功。每當我創建並嘗試使用其中的input()
函數來凍結程序時,我會得到相同的錯誤。 Cx_freeze錯誤丟失sys.stdin
我試圖運行在命令提示符下.exe
但我得到了同樣的錯誤。下面是我的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]
)
而且我簡短的測試腳本:
import sys,re
input('input')
這是一個問題,我可以修復,還是我只是有沒有input()
功能工作?我在Windows 7上使用Python 3.2,並使用相應的cx_freeze版本。 在此先感謝。
我應該在哪裏添加「base ='console'」關鍵字,以使其在控制檯中運行? – 2017-04-16 14:49:46