如何使用 py2exe 将包添加到 .exe 文件中?

发布于 2024-08-31 04:56:44 字数 302 浏览 5 评论 0原文

我有一个包含两个包的应用程序。

我的 setup.py 是这样的:

sys.argv.append('py2exe')

setup(
    options = {'py2exe': {'bundle_files': 1}},
    windows = [{'script': "SoundLog.py"}],
    zipfile = None,
)

创建 .exe 后,我必须将包放在与 .exe 文件相同的文件夹中。

如何将它们包含在 .exe 中?

提前致谢!

I have an app with two packages..

My setup.py is like this:

sys.argv.append('py2exe')

setup(
    options = {'py2exe': {'bundle_files': 1}},
    windows = [{'script': "SoundLog.py"}],
    zipfile = None,
)

After creating the .exe I have to put the packages in the same folder as the .exe file.

How can I include them in the .exe?

Thanks in advance!

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

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

发布评论

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

评论(1

浮生未歇 2024-09-07 04:56:44

我正在文件夹中搜索 .py 文件以查看代码中有多少个。
这就是我需要该文件夹的原因!

我在问题中提供的代码是正确的!

I was searching for .py files in a folder to see how many there were in the code.
That was why I needed that folder!

The code that I presented in the question is correct!

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