473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to use py2exe ...


Hi...

I'm a Linux user, and I would like some windows-friends to test a
game I'm writing with python+pygame without they needing to install
python, pygame, and so on.

I've heard about py2exe and pygame2exe, but I'm not sure on how to
use them to create:

a.- standalone exe files with a single .py program.
Example: myprogram.py

or

b.- exe files containing all my source code + data directories (png
files, data files, and so).
Example: main.py, doc/README, src/*.py and data/*
The problem is I'm not sure on how to use py2exe and pygame2exe to
build the executables...

And finally, a question: if I want to provide source code
separately ... can I include .pyc files instead of .py files?
Jan 21 '08 #1
2 7481
DHR
Here is how I am creating my win32 exe with py2exe:
1. create a setup.py file with the following:
from distutils.core import setup
import py2exe

#setup(console=['main_script.py'])
setup(windows=['main_script.py'] )

2. run the following command from console: 'python setup.py py2exe'

Hope this helps.

On Jan 21, 9:45 am, Santiago Romero <srom...@gmail.comwrote:
Hi...

I'm a Linux user, and I would like some windows-friends to test a
game I'm writing with python+pygame without they needing to install
python, pygame, and so on.

I've heard about py2exe and pygame2exe, but I'm not sure on how to
use them to create:

a.- standalone exe files with a single .py program.
Example: myprogram.py

or

b.- exe files containing all my source code + data directories (png
files, data files, and so).
Example: main.py, doc/README, src/*.py and data/*

The problem is I'm not sure on how to use py2exe and pygame2exe to
build the executables...

And finally, a question: if I want to provide source code
separately ... can I include .pyc files instead of .py files?
Jan 21 '08 #2
On Jan 21, 1:45 am, Santiago Romero <srom...@gmail.comwrote:
Hi...

I'm a Linux user, and I would like some windows-friends to test a
game I'm writing with python+pygame without they needing to install
python, pygame, and so on.

I've heard about py2exe and pygame2exe, but I'm not sure on how to
use them to create:

a.- standalone exe files with a single .py program.
Example: myprogram.py

or

b.- exe files containing all my source code + data directories (png
files, data files, and so).
Example: main.py, doc/README, src/*.py and data/*

The problem is I'm not sure on how to use py2exe and pygame2exe to
build the executables...

And finally, a question: if I want to provide source code
separately ... can I include .pyc files instead of .py files?
You should also check out the py2exe website as it has a tutorial, a
link to their mailing list, etc:

http://www.py2exe.org/

Mike
Jan 21 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
1
by: | last post by:
I want a binnary file to my aplicattion, but py2exe don't match the xmll.sax module. the py2exe shows this errors: warning: py2exe:...
2
by: Stefan Behrens | last post by:
Hi, does anybody know how I can get py2exe to work with wxPython's wxCalendarCtrl? Currently, I have just a "standard" setup.py, and py2exe gives me a syntax error. Do I need to include any...
0
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added...
8
by: Kathleen Kudzma | last post by:
Does anyone know how to resolve the following problem that I'm getting in Python 2.2 and 2.3? PROBLEM: When I try to create a classReader object I get an exception: "SAXReaderNotAvailable: No...
0
by: Steven Bell | last post by:
I am trying to build an executable from a python script. Using python 2.3, SOAPpy 0.10.3, Py2exe 0.4.2. Build command: python setup.py py2exe -w --includes xml.sax.drivers2.drv_py I get the...
6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
0
by: David Vaughan | last post by:
py2exe and Pmw problem ---------------------- I was really surprised not to find some faq setting out what to do to get py2exe working for a program using Pmw. I'm haemorrhaging time here, and...
0
by: Larry Bates | last post by:
Jimmy Retzlaff wrote: Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.9 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.