Calling py2exe from another module?

Peter Hansen peter at engcorp.com
Wed Mar 12 08:35:48 EST 2003


Alexander Skwar wrote:
> 
> So sprach Peter Hansen am 2003-03-12 um 06:16:14 -0500 :
> > Have you considered writing out a setup.py script like that,
> > then just calling it with os.system()?  It might be a more
> > direct solution for you right now.
> 
> Actually, I've taken this from my setup.py script.  But I don't really
> want to rely on having to assume that .py is associated with python.
> And besides, I'd think that calling py2exe from the module "natively" is
> more elegant (in comparison to calling the python interpreter again).

It probably is more elegant, but it's possible it's (a) not really 
a supported mode of use (i.e. entirely undocumented and not intended
to be used that way?) and (b) it might be overkill for you at this 
point.  

Regarding my suggestion: call "python setup.py" so that you don't 
need to be concerned about the association of the .py extension.

> > What is MakeEXE.py?  If it's what you wrote, surely the error
> > is coming from your own code?
> 
> Yes, MakeEXE.py is my script, and yes, the error is coming from my own
> code - kindo of, since I don't know how to call py2exe correctly ;)
> That error message was the reason why I wrote to the list.

I realize that.  My point is that without seeing the content of
your script, we *cannot* tell you what is going wrong with it.
Your script is expecting certain conditions to be true, and they
are not.  At this point, it has nothing to do with setup.py and
py2exe.  As I understand your error message, you have not provided
certain required parameters.  Provide them!  :-)  (I'm sure
that's obvious, but what isn't is why you think py2exe is
involved when the error is coming from *your* script.)

-Peter




More information about the Python-list mailing list