eike.welk at gmx.net
Tue Jan 12 01:24:24 CET 2010
On Monday January 11 2010 16:55:49 Григор wrote:
> Hi. Can I make exe file from python script. With cxfreeze on Windows no
> have problem. But how make exe on ubuntu.
On Linux programs are distributed as so called packages. A program called the
package manager opens these packages and installs the programs. Ubuntu uses
the Debian package format. These packages have the extension ".deb".
1. Creating DEBs.
This website seems to give a good overview (I have Suse which uses RPM
packages, so I have no real knowledge about it.):
An especially interesting tool seems to be this one. It creates DEBs from
Python sources with a "setup.py" script, the next alternative which I'll
2. Distributing sources
An other alternative is distributing the sources with a "setup.py" script.
Pythons distutils library then installs the program in the right place.
Distutils can also create RPMs (which are the packages for Redhat, Suse and
Mandriva). Creating a "setup.py" script is described here (unfortunately quite
The user would then extract the files from the archive, cd into the extracted
directory and run "python setup.py install".
Small overview of frequently used commands of the "setup.py" script. The
command line generally is:
python setup.py <command> [--dry-run]
Some commands are:
sdist : create source distribution. (*.tar.gz or *.zip)
bdist_wininst : create Windows executable installer (binary
bdist_rpm : create binary RPM distribution (*.rpm)
install : install the software
--dry-run : test the operation without doing anything
python setup.py --help
python setup.py --help-commands
3. Run the Windows EXE on Linux.
Wine is a set of compatibility libraries, that allow the execution of Windows
programs on Linux. However Wine is very big and it often doesn't work very
well, but it might be worth a try. Steps are:
- Start the package manager.
- Find Wine in the gigantic list of available packages.
- Select Wine and click on the "Install" button.
- Click the EXE file to run it.
More information about the Tutor