将Python 3项目导入exe? [英] Python 3 project into exe?

查看:130
本文介绍了将Python 3项目导入exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Python 3.2编写了第一个Python程序。现在,我试图弄清楚如何使其成为可执行文件。

I've made my first Python program, using Python 3.2. Now I'm trying to figure out how to make it an executable.

我几乎只需要Windows才能使用它。我进行了尽可能多的搜索,发现 py2exe 不支持Python3。 cxfreeze 可以,但是我不知道如何用它制作程序的单个可执行文件。我需要它作为一个可移植的单文件exe。

I pretty much only need it for Windows only. I've searched as much as possible and found out that py2exe doesn't support Python 3. cxfreeze does, but I can't figure out how to make a single executable of my program with it. I need it as a portable one-file exe.

请耐心等待,因为我是一个新手:)任何帮助,我们都感激不尽。

Please bear with me as I am a total newcomer :) Any help is appreciated.

推荐答案

您可以使用 cxfreeze 制作可执行文件(及其创建的其他文件),并将其压缩为使用 7-zip 的* .7z存档,然后使用 7-ZIP SFX Maker 将其转换为自解压存档。

You can use cxfreeze to make the executable (and other files it creates), compress them into a *.7z archive using 7-zip, then use 7-ZIP SFX Maker to turn it into a self extracting archive.

何时创建SFX存档,对其进行配置,以使提取文件时运行主可执行文件 cxfreeze 生成。您还可以更改档案图标,并告诉档案从临时文件夹中提取并运行。

When creating the SFX archive, configure it so that the main executable cxfreeze generates runs when the files are extracted. You can also change the archives icon, as well as tell the archive to extract and run from a temporary folder.

当用户运行exe时,文件将提取到临时文件夹,程序将运行。对用户而言,它的行为与普通的exe文件完全一样。

When the user runs the exe, the files will extract to the temporary folder and the program will run. To the user, it will behave exactly like a normal exe file.

这篇关于将Python 3项目导入exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆