Py2exe

D

D

I have a simple client/server file server app that I would like to
convert to a single .exe. The client is just uses Tkinter and displays
a simple GUI. The server has no GUI and just listens for and processes
connections. How can I convert these 2 files to an .exe, while
enabling the server app to register as a Windows service? Thanks.

Doug
 
L

Larry Bates

D said:
Jay - what I'm not sure of is the syntax to use. I have downloaded and
installed py2exe.

First a question:

Have you written the server program as a windows service? You can't
just run something as a service, it has to be written to be a service.

Your setup files will look something like the ones below.

Client:

from distutils.core import setup
import py2exe
setup(name="client", zipfile=None,
windows=[{"script":"client.py",
"icon_resources":[(1,"client.ico")]}],
options={"py2exe": {"compressed": 1,
"optimize": 2,
"bundle_files":1}}
)

Obviously the program here was called client.py. You will
need an icon to supply to icon_resources. This creates a
single .EXE file from as much as py2exe can possible put
into it.

Server:

from distutils.core import setup
import py2exe
setup(service=[script:"server.py"], zipfile=None,
options={"py2exe":{"compressed": 1,
"optimize": 2,
"bundle_files":1}}
)


Of course replace 'server' with the name of your program.

These are merely EXAMPLES. Your specific needs might be
different depending on specifics of your program.

Hope it helps.

Larry Bates
 
D

D

Thanks Larry - that is exactly what I needed! I do have the program
written to be a service, and now plan to use py2exe and Inno Setup to
package it up.

Doug
 

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
474,285
Messages
2,571,416
Members
48,108
Latest member
Virus9283

Latest Threads

Top