cx-freeze 应用程序出现问题:仅运行 1 秒

发布于 2024-12-17 15:50:14 字数 337 浏览 2 评论 0原文

我用 python 做了一个游戏,然后用 cx-freeze 导出它。由于某种原因,当我尝试双击该应用程序时,它会打开命令行大约一秒钟,然后关闭。然而,当我自己用 python IDLE 运行它时,它工作得很好。我缺少什么?

如果有帮助:我在一个名为 data 的单独文件夹中有图形文件,并且我正在使用普通的 python 模块 + pygame

I made a game in python, and then exported it with cx-freeze. For some reason, when I try to double-click on the application it opens a command line for about a second and then closes. However, when I run it myself with just the python IDLE it works fine. What am I missing?

If it helps: I have graphic files in a separate folder called data and I'm using the normal python modules + pygame.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琉璃繁缕 2024-12-24 15:50:14

如果您的应用程序是 GUI,则应该使用“Win32GUI”库冻结它,这样它就不会打开命令行。查看文档中的示例

我不知道为什么它又关闭了——也许它没有包含它需要的东西。当您使用 GUI 基础冻结它时,任何错误消息都应该出现在消息框中,这可能会帮助您找出问题所在。

If you application is a GUI, you should freeze it with the "Win32GUI" base, so it doesn't open a command line. Have a look at an example in the docs.

I don't know why it's closing again - maybe it's failed to include something it needs. When you freeze it with the GUI base, any error messages should appear in a message box, which might help you work out what the problem is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文