小编典典
这在某种程度上有效,但是存在问题。我的程序在控制台模式和GUI模式下运行。当使用--console参数从控制台运行时,它将在控制台模式下运行。当我按照下面的过程进行操作时,此操作不再起作用,那时我的程序只是一个GUI应用程序。
以下源代码来自中的示例文件\Python\Lib\site-
packages\cx_Freeze\samples\PyQt4\setup.py。一天的课。阅读自述文件。
# 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)])
2020-12-20