bash - piping name of python script to python -


i have file in directory called foo.py contains python code. how pipe file python in terminal python run it? entering terminal doesn't work:
find -name foo.py -print | python

use -exec parameter find , execute founded .py files.

find -name '*.py' -exec python {} \; 

and single file, may use

find -name 'foo.py' -exec python {} \; 

note search name foo.py in current directory subdirectories.


Comments