Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the py2exe to change the python3.2's code to exe [duplicate]

Tags:

python

exe

Possible Duplicate:
py2exe for Python 3.0

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??

like image 863
chenqiangjsj Avatar asked Jan 20 '23 10:01

chenqiangjsj


1 Answers

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

1) Look into cx-freeze

2) Install cx-freeze

3) Create your script (test.py):

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

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) Execute the python command:

python setup.py build

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.

like image 130
Nix Avatar answered Feb 16 '23 02:02

Nix