을 .pyw 당신의 "주"스크립트의 확장 (즉, 응용 프로그램을 실행) 이름을 바꿀 수 있지만, 문제가 있습니다. 내 프로그램은 콘솔 모드와 GUI 모드에서 실행됩니다. 콘솔에서 --console
인수를 사용하여 실행하면 콘솔 모드로 실행됩니다. 아래 절차를 따르면 더 이상 작동하지 않으며 내 프로그램은 GUI 응용 프로그램입니다.
다음 소스 코드는 \Python\Lib\site-packages\cx_Freeze\samples\PyQt4\setup.py
의 샘플 파일에서 가져옵니다. 오늘의 수업. README를 읽으십시오.
# A simple setup script to create an executable using PyQt4. This also
# demonstrates the method for creating a Windows executable that does not have
# an associated console.
#
# PyQt4app.py is a very simple type of PyQt4 application
#
# Run the build process by running the command 'python setup.py build'
#
# If everything works well you should find a subdirectory in the build
# subdirectory that contains the files needed to run the application
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "simple_PyQt4",
version = "0.1",
description = "Sample cx_Freeze PyQt4 script",
executables = [Executable("PyQt4app.py", base = base)])
이것은 작동하지 않는 것 같습니다. 나는 그것을 PYW로 이름을 바꾸었지만 여전히 나타났습니다. –