小典典
这在某种程度上有效,但有问题。 我的程序在控制台模式和GUI模式下运行。 使用--console参数从控制台运行时,将在控制台模式下运行。 如果按照以下步骤操作,此操作将不起作用。 当时,我的程序只是一个GUI APP应用程序。
以下源代码显示的示例文件PythonLibsite-
包 CX _ freezesamplespyqt4 setup.py。 一天的课。 阅读自述文件。
# asimplesetupscripttocreateanexecutableusingpyqt4. this also
# demonstratesthemethodforcreatingawindowsexecutablethatdoesnothave
# an关联控制台。
#
# pyqt 4a PP.pyisaverysimpletypeofpyqt4application
#
# runthebuildprocessbyrunningthecommand ' python setup.py build '
#
# ifeverythingworkswellyoushouldfindasubdirectoryinthebuild
# subdirectorythatcontainsthefilesneededtoruntheapplication
导入系统
from cx_Freeze import setup,Executable
base=None
if sys.platform=='win32':
base='Win32GUI '
设置(
name='simple_PyQt4',
版本=' 0.1 ',
description=' sample CX _ freeze pyqt 4脚本',
executables=[ executable (' pyqt 4a PP.py ',base=base ) ]
2020-12-20