newbie py2exe difficulty

E

Elaine Jackson

Hi. I'm trying to use py2exe (http://starship.python.net/crew/theller/py2exe/)
in Windows 98. I copied the necessary files into my Python23 directory (where I
have a module called 'mastermind.py'), and in the same directory I saved a
Python source file called 'setup.py' containing the following text:

from distutils.core import setup
import py2exe
setup(console=["mastermind.py"])

At this point the instructions say the following:

"""
Running

python setup.py py2exe --help

will display all available command-line flags to the py2exe command.

Now you can call the setup script like in this way:

python setup.py py2exe

and a subdirectory dist will be created, containing the files myscript.exe,
python23.dll, and library.zip.
"""

My problem is that, when I attempt to follow the first instruction (details
follow), it opens a DOS window that may indeed display all available
command-line flags to the py2exe command, but isn't very helpful because it
immediately disappears. (In fact I'm really not sure what a command-line flag
is, or what I'm supposed to do with it.) I've also tried simply running
setup.py: the DOS window disappeared immediately and there was no 'dist'
directory in evidence.

Here is what I tried regarding the first instruction:

i) Creating a shortcut to setup.py, setting its 'target' property to
'C:\Python23\setup.py --help', and double-clicking on its icon.

i) Setup | Run... | C:\Python23\python.exe setup.py py2exe --help | OK

Any help with this problem will be very much appreciated. Knowing how to create
standalone executables would give me lots of incentive to keep learning more
Python (which, incidentally, rocks).

Peace
 
M

Mike C. Fletcher

Open a command-prompt window. (You'll find the command-prompt's icon in
Start|Programs or Start|Programs|Accessories, it may be called "MSDOS
Prompt".)

Switch to the directory where your setup.py file is (use the shell's cd
command to move between directories, you can use the "dir" command to
see what files are in the current directory to confirm that the setup.py
file is present),

P:\>cd OpenGLContext

P:\OpenGLContext>dir setup.py
Volume in drive P is DATASTORE
Volume Serial Number is 74A4-1C80

Directory of P:\OpenGLContext

27/01/2004 06:01p 3,853 setup.py
1 File(s) 3,853 bytes
0 Dir(s) 11,575,771,136 bytes free

*then* run:

python setup.py py2exe --help

from that command prompt. You may need to specify the full path to
python if you haven't added your python installation directory to the
path, something like:

P:\OpenGLContext>c:\bin\lang\py23\python.exe setup.py build
running build
running build_py
running build_ext

depending on where you installed python.

HTH, and good luck,
Mike


Elaine said:
Hi. I'm trying to use py2exe (http://starship.python.net/crew/theller/py2exe/)
in Windows 98. I copied the necessary files into my Python23 directory (where I

....

My problem is that, when I attempt to follow the first instruction (details
follow), it opens a DOS window that may indeed display all available
command-line flags to the py2exe command, but isn't very helpful because it
immediately disappears. (In fact I'm really not sure what a command-line flag
is, or what I'm supposed to do with it.) I've also tried simply running
setup.py: the DOS window disappeared immediately and there was no 'dist'
directory in evidence.
....

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

Elaine Jackson

Thanks for your help. Everything's cool now.

| Open a command-prompt window. (You'll find the command-prompt's icon in
| Start|Programs or Start|Programs|Accessories, it may be called "MSDOS
| Prompt".)
|
| Switch to the directory where your setup.py file is (use the shell's cd
| command to move between directories, you can use the "dir" command to
| see what files are in the current directory to confirm that the setup.py
| file is present),
|
| P:\>cd OpenGLContext
|
| P:\OpenGLContext>dir setup.py
| Volume in drive P is DATASTORE
| Volume Serial Number is 74A4-1C80
|
| Directory of P:\OpenGLContext
|
| 27/01/2004 06:01p 3,853 setup.py
| 1 File(s) 3,853 bytes
| 0 Dir(s) 11,575,771,136 bytes free
|
| *then* run:
|
| python setup.py py2exe --help
|
| from that command prompt. You may need to specify the full path to
| python if you haven't added your python installation directory to the
| path, something like:
|
| P:\OpenGLContext>c:\bin\lang\py23\python.exe setup.py build
| running build
| running build_py
| running build_ext
|
| depending on where you installed python.
|
| HTH, and good luck,
| Mike
|
|
| Elaine Jackson wrote:
|
| >Hi. I'm trying to use py2exe
(http://starship.python.net/crew/theller/py2exe/)
| >in Windows 98. I copied the necessary files into my Python23 directory (where
I
| >
| >
| ...
|
| >My problem is that, when I attempt to follow the first instruction (details
| >follow), it opens a DOS window that may indeed display all available
| >command-line flags to the py2exe command, but isn't very helpful because it
| >immediately disappears. (In fact I'm really not sure what a command-line flag
| >is, or what I'm supposed to do with it.) I've also tried simply running
| >setup.py: the DOS window disappeared immediately and there was no 'dist'
| >directory in evidence.
| >
| >
| ...
|
| _______________________________________
| Mike C. Fletcher
| Designer, VR Plumber, Coder
| http://members.rogers.com/mcfletch/
|
|
|
 
F

Fuzzyman

Elaine Jackson said:
Hi. I'm trying to use py2exe (http://starship.python.net/crew/theller/py2exe/)
in Windows 98. I copied the necessary files into my Python23 directory (where I
have a module called 'mastermind.py'), and in the same directory I saved a
Python source file called 'setup.py' containing the following text:

from distutils.core import setup
import py2exe
setup(console=["mastermind.py"])

At this point the instructions say the following:

"""
Running

python setup.py py2exe --help

will display all available command-line flags to the py2exe command.

Now you can call the setup script like in this way:

python setup.py py2exe

and a subdirectory dist will be created, containing the files myscript.exe,
python23.dll, and library.zip.
"""

My problem is that, when I attempt to follow the first instruction (details
follow), it opens a DOS window that may indeed display all available
command-line flags to the py2exe command, but isn't very helpful because it
immediately disappears. (In fact I'm really not sure what a command-line flag
is, or what I'm supposed to do with it.) I've also tried simply running
setup.py: the DOS window disappeared immediately and there was no 'dist'
directory in evidence.

Here is what I tried regarding the first instruction:

i) Creating a shortcut to setup.py, setting its 'target' property to
'C:\Python23\setup.py --help', and double-clicking on its icon.

i) Setup | Run... | C:\Python23\python.exe setup.py py2exe --help | OK

Any help with this problem will be very much appreciated. Knowing how to create
standalone executables would give me lots of incentive to keep learning more
Python (which, incidentally, rocks).

Peace


What I do is open my setup.py using Mark Hammonds windows PythonWin
editor.
This allows you to specify command line options - and displays the
result in a window that doesn't dissappear.........

Fuzzy
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top