Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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


1 Answers

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" %*
like image 128
BipinK Avatar answered Dec 30 '25 15:12

BipinK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!