victorxiv
victorxiv

Reputation: 266

How to make an executable for a python project

Sorry if my title is not correct. Below is the explanation of what i'm looking for.

I've coded a small GUI game (let say a snake game) in python, and I want it to be run on Linux machine. I can run this program by just run command "python snake.py" in the terminal.

However, I want to combine all my .py files into one file, and when I click on this file, it just run my game. I don't want to go to shell and type "python snake.py". I means something like manifest .jar in java.

Could any one help me please? If my explanation is not good enough, please let me know. I'll give some more explanation.

Upvotes: 1

Views: 188

Answers (2)

laurentb
laurentb

Reputation: 1085

If you only want it to run on a Linux machine, using Python eggs is the simplest way.

python snake.egg will try to execute the main.py inside the egg.

Python eggs are meant to be packages, and basically is a zip file with metadata files included.

Upvotes: 1

Joachim Isaksson
Joachim Isaksson

Reputation: 180867

You can use Freeze for Unix, or py2exe for Windows.

cx_freeze, PyInstaller, bbfreeze and py2app - which I have never tried - are also available for various platforms, so there are many options.

Upvotes: 2

Related Questions