Calling py2exe from another module?

Peter Hansen peter at engcorp.com
Wed Mar 12 06:16:14 EST 2003


Alexander Skwar wrote:
> 
> I tried to import the setup module but I don't know what to do
> next.  I also tried to instantiate a object of the class
> py2exe.build_exe.py2exe which I passed this parameter:
> 
> setup(
>         name='XboxIfy',
>         scripts=['XboxIfy.py'],
>         description='Rename files in such a way, that they can be transferred to Xbox',
>         data_files=[('.',((glob.glob('*.gif') + glob.glob('*.ico')) + glob.glob('*.txt')))]
>     )

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.

> But when I call my script which should call py2exe, I get the
> following "error":
> 
> usage: MakeEXE.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
>    or: MakeEXE.py --help [cmd1 cmd2 ...]
>    or: MakeEXE.py --help-commands
>    or: MakeEXE.py cmd --help
> 
> error: no commands supplied

What is MakeEXE.py?  If it's what you wrote, surely the error
is coming from your own code?

Sorry I can't help more, yet.  I didn't even know py2exe was
designed and documented to be used this way.  (If it's not,
you'd best stick with the documented approaches, since otherwise
you have a greater risk of breakage when py2exe is modified in 
later versions.)

-Peter




More information about the Python-list mailing list