user2657599
user2657599

Reputation:

How to make a python file executable in windows

We used to make a python file executable by chmod +x manage.py. So we were able to execute like this ./manage.py. But i am using windows CLI and what command should i used to make that manage.py executable. I am not able to understand from the docs of python.org

Upvotes: 3

Views: 3501

Answers (2)

Raihaan-Tech
Raihaan-Tech

Reputation: 5

Why not try cx_Freeze? It freezes the document and makes it executable.

http://cx-freeze.sourceforge.net/

I love using it; it allows people who don't have Python installed on their computers to run and execute the file.

Upvotes: 0

BipinK
BipinK

Reputation: 125

You can do it this way:

  1. Right Click on the a .py file and go to Properties.
  2. Click "Change" on "Opens With" and browse for the location of your python executeable.

Suppose Python is installed in "D:\Program Files\Python\python.exe" then you need to key in

D:\Program Files\Python\python.exe "%1" %*

Upvotes: 4

Related Questions