Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when we need chmod +x file.py

i wrote a py script to fetch page from web,it just read write permission enough,so my question is when we need execute permission?

like image 837
mlzboy Avatar asked Dec 21 '22 22:12

mlzboy


1 Answers

Read/write is enough if you want to run it by typing python file.py. If you want to run it directly as if it were a compiled program, e.g. ./file.py, then you need execute permission (and the appropriate hash-bang line at the top).

like image 145
Michael Ekstrand Avatar answered Dec 24 '22 13:12

Michael Ekstrand