Suppose I have a python script called a.py like this:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author : Bhishan Poudel
# Date
Using the idea of @sjsam, I did following:
Suppose I have a file hello.py in any location.
cd to that location
find $PWD -type f -name "*.py" -exec chmod u+x {} \;
./hello.py
# Now, i can create any number of .py files in that folder and run ./filename
# Note: if we are running as user permission, and also have sudo access,
we can also do:
sudo -H find $PWD -type f -name "*.py" -exec chmod u+x {} \;
We should not use sudo unless absolutely necessary.
Thanks to sjsam.