[Tutor] CREATING A PR.EXE FROM A PR.PY

Dax Reyes raikage at gmail.com
Wed Sep 7 04:20:26 CEST 2005


Hello Jack,

Do you still need help regarding exe creation?
In case you do. Here are some notes I took way back in 2003.

you must create a setup.py
put something like

from distutils.core import setup
import py2exe
sbiGui = ['samplemodule', 'samplemodule.checkstatus','samplemodule.client']
sbiModules = ['anothermodule']
setup(  name="TestApp",version="1.62",
        scripts=["TestAppMain.py"],
        description="Test App",
        author="Dakila Reyes II",
        author_email="dareyes at up.edu.ph",
        url="http://whatever_put_url_here.com/",
        packages= sbiGui + sbiModules,
        data_files=[('BMP',['BMP/ARW01DN.BMP','BMP/ARW01LT.BMP','BMP/ARW01RT.BMP
','BMP/ARW01UP.BMP','BMP/logo.bmp'])],
        )

create a setup.cfg also

[py2exe]
version-companyname=Dax Reyes Solutions
version-legalcopyright=Dax Reyes
version-filedescription = TestApp Modules
version-fileversion = 1.0.0.1
version-legaltrademarks = Blah blah blah.
version-productname = TestApp
version-productversion = 1.1.1.0

Then after that
go to the current directory where TestAppMain.py and setup.py reside.
Then run
c:\your_python_install_dir\python setup.py py2exe -w -O2

This will create a subdirectory dist\TestApp that contains the exe.

*Note Check the -O2 flag, not sure what will be the side effects to your app.

Hope this helps. 

If you need to also package it into a nice simple installer. I might
be able to help.

Regards,

On 9/5/05, Jack Anema <JAnema2 at mts.net> wrote:
>  
> Can you or someone give me very specific instructions as to how to create an
>      _.EXE      file from a       _.PY      file.
> 
> I have spent a lot of time looking through all 7 sections of FAQ's at    
> http://www.python.org/doc/faq/    and many other sights.
> 
> I have also gone to    
> http://starship.python.net/crew/theller/py2exe/      and
> tried to use the general comments there.
> 
> I did download and install     *win-py2.4.exe .    This installed
> successfully as far as I can see.  There were no error messages and       
> REMOVEPY2EXE.EXE      was created in my      PYTHON24     folder.
> 
> The machine I am running, is running    XP professional, 2002.  It has a
> Pentiuum(R) 4, 1.8 Ghz CPU.  The drive has 37 GB free.
> 
> I am by no means a computer expert but I am not illiterate either.  I have
> used MS Quick Basic for many years.  In the past I have also used APL and
> Fortran on various machines over the years.  I just am not familiar enough
> with Python and have not been able to find the detailed data I need to do
> what I want.  Up to a month ago I had never heard of Python and I badly need
> the ability to make      *.PY     programs files run as     *.EXE           
> files.
> 
> Can you or someone supply the very specific instructions to do this?  I
> would also be perfectly willing to arrange with someone to call them at
> their convenience and do it over the phone and compensate the person for
> their effort and time.
> 
> I sincerely and very much appreciate anyone's response and help!  Thank you!
> Jack Anema.
> 
>  
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
>


More information about the Tutor mailing list