如何使用py2exe将python3.2的代码更改为exe [英] How can I use the py2exe to change the python3.2's code to exe

查看:66
本文介绍了如何使用py2exe将python3.2的代码更改为exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
用于Python 3.0的py2exe

Possible Duplicate:
py2exe for Python 3.0

我阅读了py2exe可以在3之前使用Python版本创建独立程序.如何使用Python 3.2创建例如请输入"Hello world.exe"吗?

I read py2exe can create a standalone program using a Python version before the 3. How, using Python 3.2, create e.g. "Hello world.exe", please??

推荐答案

p2exe几乎已死,除非您使用的是2.7或更低.

p2exe is pretty much dead, unless you are using 2.7 or less.

1)查看 cx冻结

2)安装cx-freeze

2) Install cx-freeze

3)创建您的脚本(test.py):

3) Create your script (test.py):

print("Hello there, anyone else hate hello worlds?")


4)创建setup.py文件


4) Create your setup.py file

from cx_Freeze import setup, Executable

 setup(
    name = "hatefulworld",
    version = "0.1",
    description = "I wish programming was this easy",
    executables = [Executable("test.py")])


5)执行python命令:


5) Execute the python command:

python setup.py build


6)**交叉手指,如果操作成功,则切换到build \ exe目录,然后运行程序.


6) **Cross your fingers, and if it was successful change to build\exe directory, and run your program.

我很高兴您要求提供世界一流的教程,而不是一个有用的教程,因为它从来没有像现在这样简单.

I am glad you asked for a hello world tutorial, and not a useful one because its never as easy as above.

这篇关于如何使用py2exe将python3.2的代码更改为exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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