I am writing a Python script to find and remove all .py files having corresponding .pyc files. How to extract this file list and remove them?
For example : consider there some file in /foo/bar:
file.py
file.pyc
file3.py
file2.py
file2.pyc...etc
I want to delete file.py,file2.py and not file3.py as it do not have corresponding .pyc file. and I want to do in all folders under '/'.
Is there one-liner bash code for the same?
P.S : I am using CentOS 6.8, having python2.7