python - 使用 cxFreeze 卡住 wxPython 应用程序时如何隐藏控制台窗口?

标签 python wxpython cx-freeze

我正在使用 wxPython 开发 Python 应用程序并使用 cxFreeze 卡住它。除了以下几点之外,一切似乎都很好:

当我运行 cxFreeze 创建的可执行文件时,会弹出一个空白控制台窗口。我不想表现出来。有什么办法可以隐藏吗?

cxFreeze 网站上似乎没有记录,除了一些与 Py2Exe 类似的问题之外,谷歌搜索也没有出现太多。

谢谢。

最佳答案

对于 Windows:

你必须使用这样的一行(使用适当的文件夹和名称)

C:/Python/Scripts/cxfreeze C:/Python/Code/yourprogram.py --base-name=Win32GUI --target-dir C:/Python/Dist

通过添加 --base-name=Win32GUI 选项,控制台窗口将不会出现。

关于python - 使用 cxFreeze 卡住 wxPython 应用程序时如何隐藏控制台窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2880316/

相关文章:

Python - 禁用 SecurityWarning : Certificate has no `subjectAltName` , RFC 2818 的警告

python - 从给定索引开始切片列表并用某个整数跳跃/步进它

python - ListCtrl(或 ObjectListView)中的自动换行

python - cx_Freeze 缺少模块

python - cx_freeze 不适用于 pyHooks

cx_Freeze 后 Python 脚本未写入文件

python - 如何编写 Twisted 客户端插件

python - django static_root理解-IOError-??

python - 使用 python 2.7.10 的 matplotlib.pyplot 和 wx 导入问题

python - 根据另一个笔记本选项卡中的 TextCtrl() 值更改 wx.ComboBox() 中的选择