Newbie question regarding py2exe.

M

Marco.LaRosa

Hi all,

This is a dumb question and I apologise.

I have just started using py2exe and no matter what I try, I can't get it to
work.

Sometimes modulefinder.py complains, other times its VersionInfo.py.

My question is how robust is py2exe? (Note that I have followed the docs to
the letter.)

Cheers, Marco
 
T

Thomas Heller

Hi all,

This is a dumb question and I apologise.

I have just started using py2exe and no matter what I try, I can't get it to
work.

The only thing (IMO) you can do severely wrong is to create your scripts
and your setup.py file in the lib/site-packages/py2exe directory. Use a
different directory for that.
Sometimes modulefinder.py complains, other times its VersionInfo.py.

If you only get warnings, that's ok. They are warnings;-)
Look in the dist/... directory for an exe file (and the additional dlls/pyds).

Thomas
 
R

Raymond Arthur St. Marie II of III

Marco - talking about py2exe said
Sometimes modulefinder.py complains, other times its VersionInfo.py.

My question is how robust is py2exe? (Note that I have followed the docs to
the letter.)

Cheers, Marco

I sympathize Marco.
Last night I tryed py2exe for the very first time.

I wrote a trivial random LOTTO Picker with GUI, as a test.
Used anygui - trying it for the first time also.
Just a few labels, a Button to gen the nums and a one line text box for
display.
Impressed with anygui, I moved on to py2exe.

It worked ,,,,,,,eventualy.

What I found was that...

There are no where near enough docs for py2exe.

Yeah there's plenty of info for distutils and setup scripts
but the "lazy" hacker is looking for samples.

A repository for donated, well doc'ed "setup.py" examples is
IMHO needed. Write a working setup - doc it good - mail it to the archive.
Donated because I can't expect Thomas Heller to
imaginate\dream up every possible way to write one.

I used the setup file for Aliens by (e-mail address removed)
that I found at PYGAME as an example.
I hacked it and made it my slave and it did what I expected very well.

It's amazingly robust - to answer your question above.

I looked forward to the py2exe output to list my unfound dependencies.

It did this very well.
(aside = Please someone tell me
how to capture the output to file in win32 comand line?
I didn't see an option for that in the Doc at the website.)

Writing the anygui script in Pythonwin made my backend( ) == mswgui.

(sounds nasty don't it)
This ment that all the anygui imports became the entire list of unresolved
modules.

I could only imagine that if I had gone ahead and resolved them all in the
setup
script I would still be resolving them now. ( Am I correct in assuming this
would take
me all the way down to Win32 sys dll's ? Anybody?)

Fortunately, I remembered reading that if the originating script only included
pure Python code, then the modulefinder should have no problems.

Anygui to the rescue. Switched the backend to TKgui at the import statment.
One little change and YIPPIE ! All done.
That ment that the setup.py became as simple as ...

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

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


Made my little 1.76Kb script into a whoppin 2MEGABYTES --- and that's the zip
file.

I got the entire TCL\TK source in there. 189 files including my script and the
Python dll
at 5,096kb ,,,,,,,,,, 5.1 MEG and it only took about as much wait time to build
as the zip
file did to zip it.

Does it all have to be in there? I'm fairly certain NO.

One of these day's I'll have to add an --exclude statement or 100.
But nobody's gonna want this proggy so why.

UPSHOT -- I really like both programs and look forward to learing more about
them.

Robust? You bet !

Ray St.Marie
(e-mail address removed)
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top