Easy way to make EXEs...

X

Xero Limit 126

Okay, I am completely new to Python, and I really dont understand much, but
I was wondering how to make a python script/program into a standalone .EXE?
I dont understand py2exe at all, so if someone could tell me or find me an
easy (For a newbie) to convert Python scripts to EXEs, please let me know!

Thanks for any help!
 
P

Peter Hansen

Xero said:
Okay, I am completely new to Python, and I really dont understand much, but
I was wondering how to make a python script/program into a standalone .EXE?
I dont understand py2exe at all, so if someone could tell me or find me an
easy (For a newbie) to convert Python scripts to EXEs, please let me know!

What don't you understand about py2exe? How it works, or how to actually
execute it? Or something else? If you have trouble with it, perhaps there
could be some improvements in the documentation... but nobody will know
unless you help us figure out what the problem is.

-Peter
 
X

Xero Limit 126

"What don't you understand about py2exe? How it works, or how to actually
execute it? Or something else? If you have trouble with it, perhaps there
could be some improvements in the documentation... but nobody will know
unless you help us figure out what the problem is.

-Peter"


Okay, I created the following setup file:

--- file setup.py
from distutils.core import setup
import py2exe

setup(
console = ["calculator1.py"],
)

Then, I get the following error:

-------------------------------
Traceback (most recent call last):
File "C:/WINDOWS/Desktop/Programming/Python/Programs/setup", line 4, in ?
setup(
File "C:\WINDOWS\DESKTOP\PROGRAMMING\PYTHON\BASE\lib\distutils\core.py",
line 137, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: setup [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts]
....]
or: setup --help [cmd1 cmd2 ...]
or: setup --help-commands
or: setup cmd --help

error: no commands supplied
--------------------------

I also get a pop up window to the effect "Do you want to exit all together,
Yes/No"...

I have a feeling that Im just inputing somthing incorectly, or I have
somthing installed incorrectly...

(Sorry for not going too indepth before)
 
M

Mike C. Fletcher

Xero Limit 126 wrote:
....
SystemExit: usage: setup [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts]
...]
or: setup --help [cmd1 cmd2 ...]
or: setup --help-commands
or: setup cmd --help

error: no commands supplied
setup.py requires that you specify which command, such as "install",
"bdist_wininst", or in your case "py2exe" you want to run. Distutils
(the source of the setup.py functionality) is a large package with many
operations beyond creating an exe. Try:

python setup.py py2exe

And see if that gets you farther.

Good luck,
Mike

_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
 
L

Lucas Raab

Xero Limit 126 said:
Okay, I am completely new to Python, and I really dont understand much, but
I was wondering how to make a python script/program into a standalone ..EXE?
I dont understand py2exe at all, so if someone could tell me or find me an
easy (For a newbie) to convert Python scripts to EXEs, please let me know!

Thanks for any help!
You should have no trouble with py2exe at all. A simple setup script would
be:

#setup.py
from distutils.core import setup
import py2exe

setup(name="myfile.py",
scripts=["myfile.py"],
)

Then to compile that file, go to the command prompt and switch to the
directory that the file is in. For example on my machine I would do the
following:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Lucas Raab>cd C:\Python23

C:\Python23>python setup.py py2exe

Wait a few moments for py2exe to compile your script and Voilla!! you have
an executable.
 
L

Lucas Raab

Xero Limit 126 said:
"What don't you understand about py2exe? How it works, or how to actually
execute it? Or something else? If you have trouble with it, perhaps there
could be some improvements in the documentation... but nobody will know
unless you help us figure out what the problem is.

-Peter"


Okay, I created the following setup file:

--- file setup.py
from distutils.core import setup
import py2exe

setup(
console = ["calculator1.py"],
)

Then, I get the following error:

-------------------------------
Traceback (most recent call last):
File "C:/WINDOWS/Desktop/Programming/Python/Programs/setup", line 4, in ?
setup(
File "C:\WINDOWS\DESKTOP\PROGRAMMING\PYTHON\BASE\lib\distutils\core.py",
line 137, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: setup [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts]
...]
or: setup --help [cmd1 cmd2 ...]
or: setup --help-commands
or: setup cmd --help

error: no commands supplied
--------------------------

I also get a pop up window to the effect "Do you want to exit all together,
Yes/No"...

I have a feeling that Im just inputing somthing incorectly, or I have
somthing installed incorrectly...

(Sorry for not going too indepth before)
I believe you have to go to the command prompt or whatever you're using, go
to the directory where the file is located, and type (not the quotation
marks): "python setup.py py2exe"
 
B

Bill Ludden

Voila! Yeah!
Thank You, Lucas!

Newbs appreciate people like you.
We have to search Google for hours to find a post that will put it on our level.
I can't tell you how much I appreciate the step-by-step.
Now I understand the process and the syntax.


Gracias!!!!
Grazie !!!
Thx.!!!











Lucas Raab said:
Xero Limit 126 said:
Okay, I am completely new to Python, and I really dont understand much, but
I was wondering how to make a python script/program into a standalone .EXE?
I dont understand py2exe at all, so if someone could tell me or find me an
easy (For a newbie) to convert Python scripts to EXEs, please let me know!

Thanks for any help!
You should have no trouble with py2exe at all. A simple setup script would
be:

#setup.py
from distutils.core import setup
import py2exe

setup(name="myfile.py",
scripts=["myfile.py"],
)

Then to compile that file, go to the command prompt and switch to the
directory that the file is in. For example on my machine I would do the
following:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Lucas Raab>cd C:\Python23

C:\Python23>python setup.py py2exe

Wait a few moments for py2exe to compile your script and Voilla!! you have
an executable.
 
G

Gerhard Kalab

I also find it convenient to add the following lines to setup.py
(found in a sample somewhere):

if len(sys.argv) == 1:
sys.argv.append("py2exe")

That way you can simply double-click on setup.py to create an
executable.

Gerhard

Voila! Yeah!
Thank You, Lucas!

Newbs appreciate people like you.
We have to search Google for hours to find a post that will put it on our level.
I can't tell you how much I appreciate the step-by-step.
Now I understand the process and the syntax.


Gracias!!!!
Grazie !!!
Thx.!!!











Lucas Raab said:
Xero Limit 126 said:
Okay, I am completely new to Python, and I really dont understand much, but
I was wondering how to make a python script/program into a standalone .EXE?
I dont understand py2exe at all, so if someone could tell me or find me an
easy (For a newbie) to convert Python scripts to EXEs, please let me know!

Thanks for any help!
You should have no trouble with py2exe at all. A simple setup script would
be:

#setup.py
from distutils.core import setup
import py2exe

setup(name="myfile.py",
scripts=["myfile.py"],
)

Then to compile that file, go to the command prompt and switch to the
directory that the file is in. For example on my machine I would do the
following:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Lucas Raab>cd C:\Python23

C:\Python23>python setup.py py2exe

Wait a few moments for py2exe to compile your script and Voilla!! you have
an executable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top