user2727932
user2727932

Reputation: 133

How do I make Python script executable?

I'm trying to make Python code executable using py2exe but they seem to not have Python 3.1 in the downloads page. Are there any other ways I could make Python executable? Is it ok if I changed the file extension of the code from .py to .exe?

Thanx

Upvotes: 1

Views: 946

Answers (2)

suhailvs
suhailvs

Reputation: 21690

you can cxfreeze. it is easy. and i am using it.

see this stackoverflow answer:

How to make others use my Python Script

Upvotes: 0

Mark R. Wilkins
Mark R. Wilkins

Reputation: 1302

One thing I am pretty sure you can do, though it's fragile and is not that suitable for deploying across multiple users, is make a shortcut to your Python.exe binary and edit the shortcut command line to be something like:

"C:\Python31\python.exe" <path to your script>

The main problem with this, and the reason it's not very desirable, is that each copy needs to be modified if the paths change.

Another possibility is to wrap the Python script's execution in a .bat file.

Shashank Gupta, in comments above, also recommends checking out cxfreeze. I haven't used this tool, but it might work for you.

Upvotes: 1

Related Questions